org.jscience.architecture.lift
Class SimulatedCar

java.lang.Object
  extended by org.jscience.architecture.lift.Tickable
      extended by org.jscience.architecture.lift.SimulatedCar
All Implemented Interfaces:
Car, TickableInterface

public class SimulatedCar
extends Tickable
implements Car

This file is licensed under the GNU Public Licens (GPL).
SimulatedCar is one of the most common forms of Cars, at least, in JLESA. Through the Car interface, it is not impossible to visualize real cars, for example.


Field Summary
 
Fields inherited from interface org.jscience.architecture.lift.Car
CLOSING, GOING_DOWN, GOING_UP, OPENING, PARKING, WAITING
 
Constructor Summary
SimulatedCar(int CurrentFloor, KinematicModel KinMod)
           
 
Method Summary
protected  void arrived()
          Called from the KinematicModel of the Car, this method notifies the SimulatedCar that it has arrived to it's target floor.
 boolean closeDoor()
          Tries to open the Car's door.
protected  void CrtFReached(int AbsFloor)
          Called from the KinematicModel of the Car, this method notifies the SimulatedCar that it has reached a new floor.
 void decreaseNumberOfPassangers()
          This method is called whenever a passenger leaves the Car.
 int getCapacity()
          Returns the capacity of the Car, measured in persons
 int getCrtF()
          Returns the current floor of the Car
 int getDstF()
          Returns the destination floor of the Car if it is moving.
 KinematicModel getKinematicModel()
          Returns the KinematicModel of the Car
 java.lang.String getName()
          Returns the Name of the object.
 int getNoPs()
          Returns the number of Passengers currently travelling in the Car
 int getPossibleNextFloor()
          Returns the destination floor of the Car.
 int getProgress()
          Returns the progress of the current action (closing door, going to somewhere, etc) of the Car from its KinematicModel.
 int getSrcF()
          Returns the source floor of the Car if it is moving.
 int getState()
          Returns the current state of the Car.
 java.lang.String getVersion()
          Returns the Version of the object
 boolean gotoFloor(int TargetFloor)
          Tries to send the Car to floor TargetFloor.
 void increaseNumberOfPassangers()
          This method is called whenever a passenger enters the Car.
 boolean isEmpty()
          Returns true if and only if the Car is empty.
 boolean isFull()
          Returns true if and only if the Car is full.
 boolean isMoving()
          Returns true if and only if the Car is moving.
 boolean mayStopAt(int AbsFloor)
          Returns true if and only if the Car may stop at AbsFloor before it's planned next stop from the Car's KinematicModel.
 boolean openDoor()
          Tries to open the Car's door.
 void setCapacity(int NewCapacity)
          Sets the capacity of the Car, measured in persons
 void Tick()
          This function is called in each step of the simulator.
 java.lang.String toString()
          Object
 
Methods inherited from class org.jscience.architecture.lift.Tickable
getFullName, getID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jscience.architecture.lift.TickableInterface
getFullName, getID
 

Constructor Detail

SimulatedCar

public SimulatedCar(int CurrentFloor,
                    KinematicModel KinMod)
Method Detail

decreaseNumberOfPassangers

public void decreaseNumberOfPassangers()
Description copied from interface: Car
This method is called whenever a passenger leaves the Car.

Specified by:
decreaseNumberOfPassangers in interface Car

increaseNumberOfPassangers

public void increaseNumberOfPassangers()
Description copied from interface: Car
This method is called whenever a passenger enters the Car.

Specified by:
increaseNumberOfPassangers in interface Car

setCapacity

public void setCapacity(int NewCapacity)
Description copied from interface: Car
Sets the capacity of the Car, measured in persons

Specified by:
setCapacity in interface Car
Parameters:
NewCapacity - DOCUMENT ME!

Tick

public void Tick()
Description copied from interface: TickableInterface
This function is called in each step of the simulator. In other words, this method is called whenever a discrete simulation step (0.1 second) happens. All objects that are time-variant is notified by this method that some time has elapsed since.

Specified by:
Tick in interface TickableInterface
Specified by:
Tick in class Tickable

closeDoor

public boolean closeDoor()
Description copied from interface: Car
Tries to open the Car's door.

Specified by:
closeDoor in interface Car
Returns:
true if and only if succesful.

getCapacity

public int getCapacity()
Description copied from interface: Car
Returns the capacity of the Car, measured in persons

Specified by:
getCapacity in interface Car
Returns:
DOCUMENT ME!

getCrtF

public int getCrtF()
Description copied from interface: Car
Returns the current floor of the Car

Specified by:
getCrtF in interface Car
Returns:
DOCUMENT ME!

getDstF

public int getDstF()
Description copied from interface: Car
Returns the destination floor of the Car if it is moving.

Specified by:
getDstF in interface Car
Returns:
DOCUMENT ME!

getKinematicModel

public KinematicModel getKinematicModel()
Description copied from interface: Car
Returns the KinematicModel of the Car

Specified by:
getKinematicModel in interface Car
Returns:
DOCUMENT ME!

getNoPs

public int getNoPs()
Description copied from interface: Car
Returns the number of Passengers currently travelling in the Car

Specified by:
getNoPs in interface Car
Returns:
DOCUMENT ME!

getPossibleNextFloor

public int getPossibleNextFloor()
Description copied from interface: Car
Returns the destination floor of the Car. This is the next floor where the car could stop, according to its KinematicModel.

Specified by:
getPossibleNextFloor in interface Car
Returns:
DOCUMENT ME!

getProgress

public int getProgress()
Description copied from interface: Car
Returns the progress of the current action (closing door, going to somewhere, etc) of the Car from its KinematicModel.

Specified by:
getProgress in interface Car
Returns:
DOCUMENT ME!

getSrcF

public int getSrcF()
Description copied from interface: Car
Returns the source floor of the Car if it is moving.

Specified by:
getSrcF in interface Car
Returns:
DOCUMENT ME!

getState

public int getState()
Description copied from interface: Car
Returns the current state of the Car.

Specified by:
getState in interface Car
Returns:
DOCUMENT ME!

getName

public java.lang.String getName()
Description copied from interface: TickableInterface
Returns the Name of the object.

Specified by:
getName in interface TickableInterface
Specified by:
getName in class Tickable
Returns:
DOCUMENT ME!

getVersion

public java.lang.String getVersion()
Description copied from interface: TickableInterface
Returns the Version of the object

Specified by:
getVersion in interface TickableInterface
Specified by:
getVersion in class Tickable
Returns:
DOCUMENT ME!

gotoFloor

public boolean gotoFloor(int TargetFloor)
Description copied from interface: Car
Tries to send the Car to floor TargetFloor.

Specified by:
gotoFloor in interface Car
Parameters:
TargetFloor - DOCUMENT ME!
Returns:
true if and only if succesful.

isEmpty

public boolean isEmpty()
Description copied from interface: Car
Returns true if and only if the Car is empty.

Specified by:
isEmpty in interface Car
Returns:
DOCUMENT ME!

isFull

public boolean isFull()
Description copied from interface: Car
Returns true if and only if the Car is full.

Specified by:
isFull in interface Car
Returns:
DOCUMENT ME!

isMoving

public boolean isMoving()
Description copied from interface: Car
Returns true if and only if the Car is moving.

Specified by:
isMoving in interface Car
Returns:
DOCUMENT ME!

mayStopAt

public boolean mayStopAt(int AbsFloor)
Description copied from interface: Car
Returns true if and only if the Car may stop at AbsFloor before it's planned next stop from the Car's KinematicModel.

Specified by:
mayStopAt in interface Car
Parameters:
AbsFloor - DOCUMENT ME!
Returns:
DOCUMENT ME!

openDoor

public boolean openDoor()
Description copied from interface: Car
Tries to open the Car's door.

Specified by:
openDoor in interface Car
Returns:
true if and only if succesful.

toString

public java.lang.String toString()
Description copied from interface: Car
Object

Specified by:
toString in interface Car
Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

CrtFReached

protected void CrtFReached(int AbsFloor)
Called from the KinematicModel of the Car, this method notifies the SimulatedCar that it has reached a new floor.

Parameters:
AbsFloor - DOCUMENT ME!

arrived

protected void arrived()
Called from the KinematicModel of the Car, this method notifies the SimulatedCar that it has arrived to it's target floor.