|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectmovements.PersonMovement
movements.PersonMovementTimeShifted
This class implements a movement where the participant takes the track of a given underlying movement but the speed at which the participant moves along the track in adjusted.
This object is
constructed from the original PersonMovement
object and from an array of time adjustments. The time adjustments
are used to shift the time before passing on the request for the
participant's position to the underlying PersonMovement
object. For example, if a request is made to the
PersonMovementTimeShifted object for the position at
tick 8 and the time adjustments indicate that the participant has
been slowed and is currently two ticks behind where the participant
would normally be, then the PersonMovementTimeShifted
object will pass tick 6 onto the underlying PersonMovement
to obtain the position.
| Field Summary | |
private int[] |
adjustments
The amount by which each tick must be adjusted before being passed on the the underlying PersonMovement object when getting the participant's postion. |
private PersonMovement |
originalMovement
The movement that would have been taken by the participant had no adjustment been made to avoid a collision. |
protected int |
tickLength
|
| Constructor Summary | |
(package private) |
PersonMovementTimeShifted(PersonMovement originalMovement,
int[] adjustments)
|
| Method Summary | |
(package private) ParticipantPosition |
getPosition(int ticksIntoMovement)
|
(package private) void |
getPosition(ParticipantPosition position,
int ticksIntoMovement)
|
(package private) int |
getTickLength()
|
(package private) PersonMovement |
splitMovement(int subPeriodStartTick,
int subPeriodEndTick)
Provides a movement that covers only a period of this movement. |
protected PersonMovement |
splitMovementInternal(int subPeriodStartTick,
int subPeriodEndTick)
Provides a movement that covers only a period of this movement. |
void |
Trace(java.lang.String indent)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private PersonMovement originalMovement
private int[] adjustments
protected int tickLength
| Constructor Detail |
PersonMovementTimeShifted(PersonMovement originalMovement,
int[] adjustments)
| Method Detail |
void getPosition(ParticipantPosition position,
int ticksIntoMovement)
getPosition in class PersonMovementpublic void Trace(java.lang.String indent)
Trace in class PersonMovementint getTickLength()
ParticipantPosition getPosition(int ticksIntoMovement)
final PersonMovement splitMovement(int subPeriodStartTick,
int subPeriodEndTick)
protected PersonMovement splitMovementInternal(int subPeriodStartTick,
int subPeriodEndTick)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||