org.intranet.elevator.model
Class Car
java.lang.Object
org.intranet.sim.ModelElement
org.intranet.elevator.model.Location
org.intranet.elevator.model.MovableLocation
org.intranet.elevator.model.Car
- public final class Car
- extends MovableLocation
The states of Car are substates of MovableLocation:IDLE.
Valid states:
State |
Variables |
Transitions |
destination |
location |
setDestination() |
undock() |
[MovableLocation.arrive()] |
IDLE:UNDOCKED |
null |
null |
MOVING or arrive(): DOCKED |
Illegal |
Impossible |
MOVING |
Set |
null |
MOVING or arrive(): DOCKED |
Illegal |
DOCKED [docked()] |
IDLE:UNDOCKING |
Set |
Set |
UNDOCKING |
MOVING |
Impossible |
IDLE:DOCKED |
null |
Set |
UNDOCKING |
UNDOCKED |
Impossible |
Nested classes inherited from class org.intranet.elevator.model.MovableLocation |
|
Fields inherited from class org.intranet.elevator.model.Location |
|
Constructor Summary |
Car(EventQueue eQ,
java.lang.String name,
float height,
int capacity)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
private java.lang.String name
location
private Floor location
destination
private Floor destination
panel
private FloorRequestPanel panel
listeners
private java.util.List listeners
Car
public Car(EventQueue eQ,
java.lang.String name,
float height,
int capacity)
setDestination
public void setDestination(Floor destination)
getTravelTime
public float getTravelTime(Floor floor)
undock
public void undock()
getDestination
public Floor getDestination()
getLocation
public Floor getLocation()
addListener
public void addListener(Car.Listener listener)
removeListener
public void removeListener(Car.Listener listener)
getName
public java.lang.String getName()
getFloorRequestPanel
public FloorRequestPanel getFloorRequestPanel()
getFloorAt
public Floor getFloorAt()
getRatePerSecond
public final float getRatePerSecond()
- Specified by:
getRatePerSecond
in class MovableLocation
arrive
protected void arrive()
- Specified by:
arrive
in class MovableLocation
fireDockedEvent
private void fireDockedEvent()