|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.architecture.lift.Tickable
org.jscience.architecture.lift.SimulatedCar
public class SimulatedCar
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 |
|---|
public SimulatedCar(int CurrentFloor,
KinematicModel KinMod)
| Method Detail |
|---|
public void decreaseNumberOfPassangers()
CarCar.
decreaseNumberOfPassangers in interface Carpublic void increaseNumberOfPassangers()
CarCar.
increaseNumberOfPassangers in interface Carpublic void setCapacity(int NewCapacity)
CarCar, measured in persons
setCapacity in interface CarNewCapacity - DOCUMENT ME!public void Tick()
TickableInterface
Tick in interface TickableInterfaceTick in class Tickablepublic boolean closeDoor()
CarCar's door.
closeDoor in interface Cartrue if and only if succesful.public int getCapacity()
CarCar, measured in persons
getCapacity in interface Carpublic int getCrtF()
CarCar
getCrtF in interface Carpublic int getDstF()
CarCar if it is
moving.
getDstF in interface Carpublic KinematicModel getKinematicModel()
CarKinematicModel of the Car
getKinematicModel in interface Carpublic int getNoPs()
CarPassengers currently travelling in
the Car
getNoPs in interface Carpublic int getPossibleNextFloor()
CarCar. This is the
next floor where the car could stop, according to its KinematicModel.
getPossibleNextFloor in interface Carpublic int getProgress()
CarCar from its KinematicModel.
getProgress in interface Carpublic int getSrcF()
CarCar if it is moving.
getSrcF in interface Carpublic int getState()
CarCar.
getState in interface Carpublic java.lang.String getName()
TickableInterface
getName in interface TickableInterfacegetName in class Tickablepublic java.lang.String getVersion()
TickableInterface
getVersion in interface TickableInterfacegetVersion in class Tickablepublic boolean gotoFloor(int TargetFloor)
CarCar to floor TargetFloor.
gotoFloor in interface CarTargetFloor - DOCUMENT ME!
true if and only if succesful.public boolean isEmpty()
CarCar is empty.
isEmpty in interface Carpublic boolean isFull()
CarCar is full.
isFull in interface Carpublic boolean isMoving()
CarCar is moving.
isMoving in interface Carpublic boolean mayStopAt(int AbsFloor)
CarCar may stop at AbsFloor before it's planned next stop from the Car's KinematicModel.
mayStopAt in interface CarAbsFloor - DOCUMENT ME!
public boolean openDoor()
CarCar's door.
openDoor in interface Cartrue if and only if succesful.public java.lang.String toString()
CarObject
toString in interface CartoString in class java.lang.Objectprotected void CrtFReached(int AbsFloor)
KinematicModel of the Car, this
method notifies the SimulatedCar that it has reached a new
floor.
AbsFloor - DOCUMENT ME!protected void arrived()
KinematicModel of the Car, this
method notifies the SimulatedCar that it has arrived to it's
target floor.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||