edu.udo.cs.ie.cowbots.internalActions.scout
Class astar
java.lang.Object
DefaultInternalAction
edu.udo.cs.ie.cowbots.internalActions.scout.astar
public class astar
- extends DefaultInternalAction
Nested Class Summary |
(package private) class |
astar.Node
|
Constructor Summary |
astar()
|
Method Summary |
private void |
checkPathAtSwitch()
|
private void |
computPath(astar.Node n)
|
java.lang.Object |
execute(TransitionSystem ts,
Unifier un,
Term[] args)
|
private java.lang.String[] |
extractPath(java.util.ArrayList<astar.Node> nodePath)
|
private java.lang.String |
getMove(astar.Node from,
astar.Node to)
|
private java.lang.String[] |
getPath(int sX,
int sY,
int tX,
int tY)
|
java.lang.String[] |
getPath(TransitionSystem ts,
int sX,
int sY,
int tX,
int tY,
boolean surroundCows)
Calculates path with a*, same logic as execute, but not
as internal action. |
private void |
populateNodes(int tX,
int tY)
|
private void |
printMap()
|
private void |
printMapScore()
|
private void |
selectNearTarget()
|
private void |
setCowWeights()
|
private void |
setSurroundWeightsByDirection()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
path
java.lang.String[] path
map
GridMap map
cowbot
ICowbot cowbot
surroundCows
boolean surroundCows
ignoreFence
boolean ignoreFence
ignoreAlly
boolean ignoreAlly
experimental_obstacle
public boolean experimental_obstacle
experimental_cowsight
public boolean experimental_cowsight
experimental_newposition
public boolean experimental_newposition
cluster_agentwall
public boolean cluster_agentwall
addCowWeight
public int addCowWeight
addSightWeight
public int addSightWeight
sX
int sX
sY
int sY
tX
int tX
tY
int tY
x
int x
y
int y
lastWorldTime
int lastWorldTime
openSet
java.util.ArrayList<astar.Node> openSet
closeSet
java.util.ArrayList<astar.Node> closeSet
nodePath
java.util.ArrayList<astar.Node> nodePath
nodes
astar.Node[][] nodes
astar
public astar()
execute
public java.lang.Object execute(TransitionSystem ts,
Unifier un,
Term[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
checkPathAtSwitch
private void checkPathAtSwitch()
getPath
public java.lang.String[] getPath(TransitionSystem ts,
int sX,
int sY,
int tX,
int tY,
boolean surroundCows)
throws java.lang.Exception
- Calculates path with a*, same logic as execute, but not
as internal action. Uses by other internal actions and
by the planner.
- Parameters:
ts
- TransitionSystemsX
- From XsY
- From YtX
- To XtY
- To YsurroundCows
-
- Returns:
-
- Throws:
java.lang.Exception
populateNodes
private void populateNodes(int tX,
int tY)
setCowWeights
private void setCowWeights()
setSurroundWeightsByDirection
private void setSurroundWeightsByDirection()
printMapScore
private void printMapScore()
printMap
private void printMap()
selectNearTarget
private void selectNearTarget()
getPath
private java.lang.String[] getPath(int sX,
int sY,
int tX,
int tY)
computPath
private void computPath(astar.Node n)
extractPath
private java.lang.String[] extractPath(java.util.ArrayList<astar.Node> nodePath)
getMove
private java.lang.String getMove(astar.Node from,
astar.Node to)