Class CognitiveAgentNavigationAction2D
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.Action
,it.unibo.alchemist.model.cognitive.NavigationAction
,it.unibo.alchemist.model.cognitive.SteeringAction
,java.io.Serializable
public class CognitiveAgentNavigationAction2D<T extends Object, L extends ConvexShape<Euclidean2DPosition, Euclidean2DTransformation>, R extends Object> extends AbstractNavigationAction<T, Euclidean2DPosition, Euclidean2DTransformation, L, R, ConvexPolygon, Euclidean2DPassage>
Implementation of a NavigationAction2D. This action accepts an Euclidean2DEnvironmentWithGraph whose graph contains ConvexPolygonal nodes and Euclidean2DPassages as edges.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Double
DEFAULT_WALL_REPULSION_FACTOR
private final Euclidean2DEnvironmentWithGraph<?, T, ConvexPolygon, Euclidean2DPassage>
environment
private final Node<T>
navigatingNode
private Euclidean2DPosition
pedestrianPosition
private ConvexPolygon
currentRoom
private final Euclidean2DPosition
desiredPosition
private final Double
maxWalk
private final OrientingProperty<T, Euclidean2DPosition, Euclidean2DTransformation, L, ConvexPolygon, Euclidean2DPassage>
orientingProperty
-
Constructor Summary
Constructors Constructor Description CognitiveAgentNavigationAction2D(Euclidean2DEnvironmentWithGraph<?, T, ConvexPolygon, Euclidean2DPassage> environment, Reaction<T> reaction, PedestrianProperty<T> pedestrian, Double wallRepulsionFactor)
-
Method Summary
Modifier and Type Method Description Euclidean2DEnvironmentWithGraph<?, T, ConvexPolygon, Euclidean2DPassage>
getEnvironment()
The environment the navigatingNode is into. Unit
crossDoor(Euclidean2DPassage door)
Moves the node across the provided door, which must be among doorsInSight. Euclidean2DPosition
nextPosition()
The position the owner of this action moves to when it is executed, in relative coordinates with respect to its current position. CognitiveAgentNavigationAction2D<T, L, R>
cloneAction(Node<T> node, Reaction<T> reaction)
This method allows to clone this action on a new node. -
Methods inherited from class it.unibo.alchemist.model.cognitive.actions.AbstractNavigationAction
doorsInSight, getCurrentRoom, getDesiredPosition, getNavigatingNode, getPedestrianPosition, moveToFinal, setCurrentRoom, setPedestrianPosition, update
-
Methods inherited from class it.unibo.alchemist.model.cognitive.actions.AbstractSteeringAction
getMaxWalk, getNextPosition
-
Methods inherited from class it.unibo.alchemist.model.cognitive.NavigationAction
getOrientingProperty, stop
-
Methods inherited from class it.unibo.alchemist.model.actions.AbstractAction
getOutboundDependencies, toString
-
Methods inherited from class it.unibo.alchemist.model.actions.AbstractMoveNode
execute, getContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
CognitiveAgentNavigationAction2D
CognitiveAgentNavigationAction2D(Euclidean2DEnvironmentWithGraph<?, T, ConvexPolygon, Euclidean2DPassage> environment, Reaction<T> reaction, PedestrianProperty<T> pedestrian, Double wallRepulsionFactor)
-
-
Method Detail
-
getEnvironment
Euclidean2DEnvironmentWithGraph<?, T, ConvexPolygon, Euclidean2DPassage> getEnvironment()
The environment the navigatingNode is into.
-
crossDoor
Unit crossDoor(Euclidean2DPassage door)
Moves the node across the provided door, which must be among doorsInSight.
-
nextPosition
Euclidean2DPosition nextPosition()
The position the owner of this action moves to when it is executed, in relative coordinates with respect to its current position.
-
cloneAction
CognitiveAgentNavigationAction2D<T, L, R> cloneAction(Node<T> node, Reaction<T> reaction)
This method allows to clone this action on a new node. It may result useful to support runtime creation of nodes with the same reaction programming, e.g. for morphogenesis.
- Parameters:
node
-The node where to clone this {@link Action}
reaction
-The reaction to which the CURRENT action is assigned
- Returns:
the cloned action
-
-
-
-