movements
Class PersonMovement

java.lang.Object
  extended bymovements.PersonMovement
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
PersonMovementAlone, PersonMovementFix, PersonMovementInAUnit, PersonMovementInTransition, PersonMovementList, PersonMovementSplitter, PersonMovementTimeShifted

abstract class PersonMovement
extends java.lang.Object
implements java.io.Serializable

An object of this class represents a movement of a person over a period of time. A person's position is defined using three co-ordinates giving the distance down the set, the distance across the set, and the direction in which the person is facing.

This class is abstract. Classes are derived from this class that implement various movements. For example, a derived class may implement a movement in a straight line, another derived class may implement a movement in a circle.


Field Summary
protected  int tickLength
           
 
Constructor Summary
(package private) PersonMovement(int tickLength)
           
 
Method Summary
(package private)  ParticipantPosition getPosition(int ticksIntoMovement)
           
(package private) abstract  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

tickLength

protected int tickLength
Constructor Detail

PersonMovement

PersonMovement(int tickLength)
Method Detail

getTickLength

int getTickLength()

getPosition

abstract void getPosition(ParticipantPosition position,
                          int ticksIntoMovement)

getPosition

ParticipantPosition getPosition(int ticksIntoMovement)

Trace

public void Trace(java.lang.String indent)

splitMovement

final PersonMovement splitMovement(int subPeriodStartTick,
                                   int subPeriodEndTick)
Provides a movement that covers only a period of this movement. This method does some error checking and handles the request in a couple of trivial situations. It calls an implementation specific method to handle the non-trivial cases.


splitMovementInternal

protected PersonMovement splitMovementInternal(int subPeriodStartTick,
                                               int subPeriodEndTick)
Provides a movement that covers only a period of this movement. This is a default implementation that uses the PersonMovementSplitter to provide the desired sub-movement. However, most implementations of PersonMovement can do this more efficiently and so override this method. By allowing each PersonMovement implementation to implement this, we get a simpler tree of PersonMovement objects.



Copyright © 2003 Nigel Westbury