Class PathPlannerComponent

java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.pathfinding.PathPlannerComponent

public class PathPlannerComponent extends DiarcComponent
  • Field Details

    • grid

      protected Map<Integer,Map<Integer,Float>> grid
    • registerForBeliefNotifications

      protected boolean registerForBeliefNotifications
    • shouldLogBeliefMsg

      protected boolean shouldLogBeliefMsg
  • Constructor Details

    • PathPlannerComponent

      public PathPlannerComponent()
  • Method Details

    • init

      protected void init()
      Description copied from class: DiarcComponent
      Perform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.
      Overrides:
      init in class DiarcComponent
    • executionLoop

      protected void executionLoop()
      Description copied from class: DiarcComponent
      This is where any code that needs to be called repeatedly in a dedicated thread should live. It is not called by default and you must set shouldRunExecutionLoop to true in your constructor.
      Overrides:
      executionLoop in class DiarcComponent
    • resetMap

      public void resetMap()
    • updateMap

      public void updateMap(Term atTerm, List<Map<Variable,Symbol>> bindings)
    • isPassable

      public boolean isPassable(int x, int y)
    • isEmpty

      public boolean isEmpty(int x, int y)
    • isBreakable

      public boolean isBreakable(Symbol locx, Symbol locy)
    • findPath

      public Justification findPath(Symbol startX, Symbol startY, Symbol goalX, Symbol goalY, List<Predicate> path)
      Wrapper around findPath that makes usage from an action script easier. The returned path is a list of at(ACTOR,x,y) predicates defining each step of the path.
      Parameters:
      startX -
      startY -
      goalX -
      goalY -
      path -
      Returns:
    • findPath

      public Integer findPath(int startX, int startY, int goalX, int goalY, List<org.apache.commons.lang3.tuple.Pair<Integer,Integer>> path)
      Find path from [startX,startY] to [goalX,goalY] using A*. This finds the path with min weight, which can be a path containing objects in the way.
      Parameters:
      startX -
      startY -
      goalX -
      goalY -
      path -
      Returns:
    • findDirectPath

      public Justification findDirectPath(Symbol startX, Symbol startY, Symbol goalX, Symbol goalY, List<Symbol> path)
      Wrapper around findDirectPath that makes usage from an action script easier. The returned path is a list of at(agent,x,y) predicates defining each step of the path.
      Parameters:
      startX -
      startY -
      goalX -
      goalY -
      path -
      Returns:
    • findDirectPath

      public List<org.apache.commons.lang3.tuple.Pair<Integer,Integer>> findDirectPath(int startX, int startY, int goalX, int goalY)
      Euclidean path from [startX,startY] to [goalX,goalY]. TODO: replace this with a findMostClearPath implementation that tries to avoid as many obstacles as possible
      Parameters:
      startX -
      startY -
      goalX -
      goalY -
      Returns: