Class AbstractNavigationAction
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.Action
,it.unibo.alchemist.model.cognitive.NavigationAction
,it.unibo.alchemist.model.cognitive.SteeringAction
,java.io.Serializable
public abstract class AbstractNavigationAction<T extends Object, P extends Position<P>, Vector<P>, A extends Transformation<P>, L extends ConvexShape<P, A>, R extends Object, N extends ConvexShape<P, A>, E extends Object> extends AbstractSteeringAction<T, P, A> implements NavigationAction<T, P, A, L, R, N, E>
An abstract NavigationAction, taking care of properly moving the node in the environment while delegating the decision on where to move it to a NavigationStrategy.
-
-
Field Summary
Fields Modifier and Type Field Description private final Node<T>
navigatingNode
private P
pedestrianPosition
private N
currentRoom
private final P
desiredPosition
private final EnvironmentWithGraph<?, T, P, A, N, E>
environment
private final Double
maxWalk
private final OrientingProperty<T, P, A, L, N, E>
orientingProperty
-
Constructor Summary
Constructors Constructor Description AbstractNavigationAction(EnvironmentWithGraph<?, T, P, A, N, E> environment, Reaction<T> reaction, PedestrianProperty<T> pedestrian)
-
Method Summary
Modifier and Type Method Description Node<T>
getNavigatingNode()
The owner of this action. P
getPedestrianPosition()
The position of the navigatingNode in the environment, this is cached and updated every time update is called so as to avoid potentially costly re-computations. Unit
setPedestrianPosition(P pedestrianPosition)
The position of the navigatingNode in the environment, this is cached and updated every time update is called so as to avoid potentially costly re-computations. N
getCurrentRoom()
The room (= environment's area) the navigatingNode is into, this is cached and updated every time update is called so as to avoid potentially costly re-computations. Unit
setCurrentRoom(N currentRoom)
The room (= environment's area) the navigatingNode is into, this is cached and updated every time update is called so as to avoid potentially costly re-computations. final P
getDesiredPosition()
EnvironmentWithGraph<?, T, P, A, N, E>
getEnvironment()
The environment the navigatingNode is into. List<E>
doorsInSight()
Unit
moveToFinal(P destination)
Moves the node to the given final destination, which must be inside currentRoom. Unit
update()
Updates the internal state but does not move the node. -
Methods inherited from class it.unibo.alchemist.model.cognitive.actions.AbstractSteeringAction
cloneAction, getMaxWalk, getNextPosition
-
Methods inherited from class it.unibo.alchemist.model.cognitive.NavigationAction
crossDoor, getOrientingProperty, stop
-
Methods inherited from class it.unibo.alchemist.model.cognitive.SteeringAction
nextPosition
-
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
-
AbstractNavigationAction
AbstractNavigationAction(EnvironmentWithGraph<?, T, P, A, N, E> environment, Reaction<T> reaction, PedestrianProperty<T> pedestrian)
-
-
Method Detail
-
getNavigatingNode
Node<T> getNavigatingNode()
The owner of this action.
-
getPedestrianPosition
P getPedestrianPosition()
The position of the navigatingNode in the environment, this is cached and updated every time update is called so as to avoid potentially costly re-computations.
-
setPedestrianPosition
Unit setPedestrianPosition(P pedestrianPosition)
The position of the navigatingNode in the environment, this is cached and updated every time update is called so as to avoid potentially costly re-computations.
-
getCurrentRoom
N getCurrentRoom()
The room (= environment's area) the navigatingNode is into, this is cached and updated every time update is called so as to avoid potentially costly re-computations.
-
setCurrentRoom
Unit setCurrentRoom(N currentRoom)
The room (= environment's area) the navigatingNode is into, this is cached and updated every time update is called so as to avoid potentially costly re-computations.
-
getDesiredPosition
final P getDesiredPosition()
-
getEnvironment
EnvironmentWithGraph<?, T, P, A, N, E> getEnvironment()
The environment the navigatingNode is into.
-
doorsInSight
List<E> doorsInSight()
-
moveToFinal
Unit moveToFinal(P destination)
Moves the node to the given final destination, which must be inside currentRoom.
-
-
-
-