org.jscience.architecture.lift
Class LoadDependentKinematicModel

java.lang.Object
  extended by org.jscience.architecture.lift.LoadDependentKinematicModel
All Implemented Interfaces:
KinematicModel

public class LoadDependentKinematicModel
extends java.lang.Object
implements KinematicModel

This file is licensed under the GNU Public Licens (GPL).
This is a fairly simple implementation of a load-dependend KinematicModel. The time needed to reach Floor #I from Floor #J is (the difference of I and J is K) is BaseTime+KFloorFligthTime, where BaseTime and FloorFlightTime may depend on the number of Passengers in the Car.

See Also:
LoadSpeed

Constructor Summary
LoadDependentKinematicModel(LoadSpeed[] Config)
          Constructor
 
Method Summary
 void dstFChanged(Car C)
          Notifies the Kinematic Model that the destination floor of the moving Car has changed.
 int getDoorCloseTime(int AbsFloor, Car C)
          Returns the time (in Ticks) needed to close the door of the Car C on the AbsFloorth Floor.
 int getDoorOpenTime(int AbsFloor, Car C)
          Returns the time (in Ticks) needed to open the door of the Car C on the AbsFloorth Floor.
 int getLoadTablesLength()
          DOCUMENT ME!
 double getProgress(Car C)
          Gets the Progress of a Car in the [0, 1] interval.
 boolean mayStopAt(Car C, int AbsFloor)
          This method is used to determinate if the Car C may stop on floor AbsFloor before its next planned stop without reversing its direction.
 void tick(SimulatedCar C)
          Cars inherit void Tick() from the Tickable interface and call this function each time their Tick() method is called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoadDependentKinematicModel

public LoadDependentKinematicModel(LoadSpeed[] Config)
Constructor

Parameters:
Config - Configuration tables in the form of a LoadSpeed array.
Method Detail

getLoadTablesLength

public int getLoadTablesLength()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getDoorCloseTime

public int getDoorCloseTime(int AbsFloor,
                            Car C)
Description copied from interface: KinematicModel
Returns the time (in Ticks) needed to close the door of the Car C on the AbsFloorth Floor.

Specified by:
getDoorCloseTime in interface KinematicModel

getDoorOpenTime

public int getDoorOpenTime(int AbsFloor,
                           Car C)
Description copied from interface: KinematicModel
Returns the time (in Ticks) needed to open the door of the Car C on the AbsFloorth Floor.

Specified by:
getDoorOpenTime in interface KinematicModel

getProgress

public double getProgress(Car C)
Description copied from interface: KinematicModel
Gets the Progress of a Car in the [0, 1] interval. This is only applicable if the doors are closing or opening or if the Car is moving from one floor to another. This should be 0.25 if the door is only 25 percent open, 0.66 if the car already moved 66% of the distance between two adjacent floors, and so on.

Specified by:
getProgress in interface KinematicModel
Parameters:
C - The target Car
Returns:
The 0<=Progress<=1 value

dstFChanged

public void dstFChanged(Car C)
Description copied from interface: KinematicModel
Notifies the Kinematic Model that the destination floor of the moving Car has changed. This usually happens when a Car catches a call that appears after it's start.

Specified by:
dstFChanged in interface KinematicModel
Parameters:
C - The Car which changed its destination floor

mayStopAt

public boolean mayStopAt(Car C,
                         int AbsFloor)
Description copied from interface: KinematicModel
This method is used to determinate if the Car C may stop on floor AbsFloor before its next planned stop without reversing its direction. This occures when a moving Car needs to determine if it may accept a new call between its current floor and planned destination floor.

Specified by:
mayStopAt in interface KinematicModel

tick

public void tick(SimulatedCar C)
Description copied from interface: KinematicModel
Cars inherit void Tick() from the Tickable interface and call this function each time their Tick() method is called. Before calling, the Car increasess it's Progress by one. This happens in every Tick(), namely in every 0.1 second, so this method is called for each Car in every 0.1 second of simulation time.
It must call C.arrived() if the C Car arrives at it's planned destination Floor.
It must call C.CrtFReached() if the C Car is reached the next floor while moving

Specified by:
tick in interface KinematicModel
Parameters:
C - The Car which called this method.