m865.simulation
Class ElevatorArrivalEvent
java.lang.Object
m865.simulation.Event
m865.simulation.DepartmentStoreEvent
m865.simulation.ElevatorArrivalEvent
- All Implemented Interfaces:
- java.lang.Comparable, Prioritizeable
public class ElevatorArrivalEvent
- extends DepartmentStoreEvent
The ElevatorArrivalEvent checks ButtonSystem Status and Passenger goals.
Schedules an OffLoadEvent or a MoveOnEvent.
Method Summary |
void |
fire()
The fire method tells the elevator that is is now at this floor,
then it creates and schedules either an OffLoadEvent or a MoveOnEvent
If passengers inside the elevator want to get off at the arrivalFloor,
the elevator will stop at this floor. |
java.lang.String |
toString()
The basic toString method |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
elevator
protected Elevator elevator
- The elevator
arrivalFloor
protected int arrivalFloor
- floor that the elevator is at
ElevatorArrivalEvent
public ElevatorArrivalEvent(java.lang.Integer time,
DepartmentStore store,
Elevator elev,
int floor)
- Constructor for ElevatorArrivalEvent.
- time - The firing time of this event.
- departmentStore - The departmentStore that owns this event.
- elevator - The elevator associated with this event.
fire
public void fire()
- The fire method tells the elevator that is is now at this floor,
then it creates and schedules either an OffLoadEvent or a MoveOnEvent
- If passengers inside the elevator want to get off at the arrivalFloor,
the elevator will stop at this floor.
Schedule an OffLoadEvent.
- If no passengers inside the elevator want to
get off at the arrivalFloor (the elevator is not empty),
Call CheckButtonSystemAtArrivalFloor.
The elevator will stop at this floor.
Schedule an OffLoadEvent.
- If the elevator is empty,
call ButtonSystemOffArrivalFloor.
The elevator will continue moving
Schedule a MoveOnEvent.
- Specified by:
fire
in class Event
toString
public java.lang.String toString()
- The basic toString method
- Overrides:
toString
in class Event
- Returns:
- a string identifying this event