-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.interfaces.NavigationStrategy
public class RouteFollowing<T extends Object, L extends ConvexGeometricShape<Euclidean2DPosition, Euclidean2DTransformation>, R extends Object> extends DynamicPursuing<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 Pursuing 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 pedestrian reach that exact position), apart from the last waypoint which is actually approached. Cuts to the route are allowed (i.e. if the pedestrian 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 Euclidean2DPositiondestinationprivate final NavigationAction<T, Euclidean2DPosition, Euclidean2DTransformation, L, R, ConvexPolygon, Euclidean2DPassage>action
-
Constructor Summary
Constructors Constructor Description RouteFollowing(NavigationAction<T, Euclidean2DPosition, Euclidean2DTransformation, L, R, ConvexPolygon, Euclidean2DPassage> action, List<Euclidean2DPosition> route)
-
Method Summary
Modifier and Type Method Description Euclidean2DPositiongetDestination()The destination to pursue. UnitsetDestination(Euclidean2DPosition destination)The destination to pursue. NavigationAction<T, Euclidean2DPosition, Euclidean2DTransformation, L, R, ConvexPolygon, Euclidean2DPassage>getAction()The NavigationAction used to navigate the environment. UnitinUnexpectedNewRoom(ConvexPolygon previousRoom, ConvexPolygon expectedNewRoom, ConvexPolygon actualNewRoom)When in an unexpected room the pedestrian gets back to previousRoom so as to continue following the route correctly. UnitinNewRoom(ConvexPolygon newRoom)This is called whenever the pedestrian enters a new room. -
-
Constructor Detail
-
RouteFollowing
RouteFollowing(NavigationAction<T, Euclidean2DPosition, Euclidean2DTransformation, L, R, ConvexPolygon, Euclidean2DPassage> action, List<Euclidean2DPosition> route)
-
-
Method Detail
-
getDestination
Euclidean2DPosition getDestination()
The destination to pursue.
-
setDestination
Unit setDestination(Euclidean2DPosition destination)
The destination to pursue.
-
getAction
NavigationAction<T, Euclidean2DPosition, Euclidean2DTransformation, L, R, ConvexPolygon, Euclidean2DPassage> getAction()
The NavigationAction used to navigate the environment.
-
inUnexpectedNewRoom
Unit inUnexpectedNewRoom(ConvexPolygon previousRoom, ConvexPolygon expectedNewRoom, ConvexPolygon actualNewRoom)
When in an unexpected room the pedestrian gets back to previousRoom so as to continue following the route correctly.
-
inNewRoom
Unit inNewRoom(ConvexPolygon newRoom)
This is called whenever the pedestrian enters a new room.
-
-
-
-