edu.udo.cs.ie.cowbots.internalActions.scout
Class astar

Package class diagram package astar
java.lang.Object
  extended by DefaultInternalAction
      extended by edu.udo.cs.ie.cowbots.internalActions.scout.astar

public class astar
extends DefaultInternalAction


Nested Class Summary
(package private)  class astar.Node
           
 
Field Summary
 int addCowWeight
           
 int addSightWeight
           
(package private)  java.util.ArrayList<astar.Node> closeSet
           
 boolean cluster_agentwall
           
(package private)  ICowbot cowbot
           
 boolean experimental_cowsight
           
 boolean experimental_newposition
           
 boolean experimental_obstacle
           
(package private)  boolean ignoreAlly
           
(package private)  boolean ignoreFence
           
(package private)  int lastWorldTime
           
(package private)  GridMap map
           
(package private)  java.util.ArrayList<astar.Node> nodePath
           
(package private)  astar.Node[][] nodes
           
(package private)  java.util.ArrayList<astar.Node> openSet
           
(package private)  java.lang.String[] path
           
(package private)  boolean surroundCows
           
(package private)  int sX
           
(package private)  int sY
           
(package private)  int tX
           
(package private)  int tY
           
(package private)  int x
           
(package private)  int y
           
 
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
 

Field Detail

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
Constructor Detail

astar

public astar()
Method Detail

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 - TransitionSystem
sX - From X
sY - From Y
tX - To X
tY - To Y
surroundCows -
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)