Class FollowRoute
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.cognitive.NavigationStrategy
public class FollowRoute<T extends Object, L extends ConvexShape<Euclidean2DPosition, Euclidean2DTransformation>, R extends Object> extends DynamicallyPursue<T, L, R>
A NavigationStrategy allowing to follow a given route. The route consists of a list of positions (= waypoints) that may or may not be in sight of each other (i.e. the path leading from a waypoint to the next one may or may not be representable as a single segment), for this reason Pursue behavior is used to reach each waypoint. In this context, a waypoint is considered reached when it's inside the current room (not when the node reach that exact position), apart from the last waypoint which is actually approached. Cuts to the route are allowed (i.e. if the node finds a waypoint which is farther than the expected next one, he/she skips all the waypoints in between).
-
-
Field Summary
Fields Modifier and Type Field Description private Euclidean2DPosition
destination
private final NavigationAction<T, Euclidean2DPosition, Euclidean2DTransformation, L, R, ConvexPolygon, Euclidean2DPassage>
action
private final OrientingProperty<T, Euclidean2DPosition, Euclidean2DTransformation, L, ConvexPolygon, Euclidean2DPassage>
orientingCapability
-
Constructor Summary
Constructors Constructor Description FollowRoute(NavigationAction<T, Euclidean2DPosition, Euclidean2DTransformation, L, R, ConvexPolygon, Euclidean2DPassage> action, List<Euclidean2DPosition> route)
-
Method Summary
Modifier and Type Method Description Unit
inUnexpectedNewRoom(ConvexPolygon previousRoom, ConvexPolygon expectedNewRoom, ConvexPolygon actualNewRoom)
When in an unexpected room the node gets back to previousRoom to continue following the route correctly. Unit
inNewRoom(ConvexPolygon newRoom)
This is called whenever the node enters a new room. -
Methods inherited from class it.unibo.alchemist.model.cognitive.navigation.DynamicallyPursue
setDestination, setDestination
-
Methods inherited from class it.unibo.alchemist.model.cognitive.navigation.Explore
getAction
-
Methods inherited from class it.unibo.alchemist.model.cognitive.NavigationStrategy
getOrientingCapability
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
FollowRoute
FollowRoute(NavigationAction<T, Euclidean2DPosition, Euclidean2DTransformation, L, R, ConvexPolygon, Euclidean2DPassage> action, List<Euclidean2DPosition> route)
-
-
Method Detail
-
inUnexpectedNewRoom
Unit inUnexpectedNewRoom(ConvexPolygon previousRoom, ConvexPolygon expectedNewRoom, ConvexPolygon actualNewRoom)
When in an unexpected room the node gets back to previousRoom to continue following the route correctly.
-
inNewRoom
Unit inNewRoom(ConvexPolygon newRoom)
This is called whenever the node enters a new room.
-
-
-
-