Moves the specified
MovingRoadUser following the specified path and
with the specified time. The provided
path
can not be empty
and there must be time left in the provided
TimeLapse.
Speed
The
MovingRoadUser has to define a speed with which it wants to
travel. This method uses the
MovingRoadUsers speed as an
upper bound, it gives no guarantee about the lower bound (i.e. the
object could stand still). The actual speed of the object depends on the
model implementation. A model can define constraints such as speed limits
or traffic jams which can slow down a
MovingRoadUser.
Path
The
MovingRoadUser follows the path that is specified by the
provided
Queue. This path is composed of a number of
Points, which will be traveled in order as they appear. For example: consider
that the path contains three points: A, B, C
. The
MovingRoadUser will first travel to
Point A
,
once it has reached this point it will be removed out of the
Queue. This means that after this method is finished the provided
Queue will contain only B, C
. By storing the reference
to the queue, users of this method can repeatedly call this method using
the same path object instance. The
#getDestination(MovingRoadUser)method will return the last point of the path specified in the most recent
invocation of this method.
Note that when an invalid path is supplied this method will throw an
IllegalArgumentException. This method guarantees that the road
model will not be in an invalid state when this happens. The path that is
supplied may not be in a valid state. This means that it is safe to put
invocations of this method in a try/catch block but that it is not safe to
reuse the supplied path.
Time
The time that is specified as indicated by the
TimeLapse object may
or may not be consumed completely. Normally, this method will try to
consume all time in the
TimeLapse object. In case the end of the
path is reached before all time is consumed (which depends on the object's
speed, the length of the path
and any speed constraints
if available) there will be some time left in the
TimeLapse.