m865.simulation
Class ElevatorArrivalEvent

java.lang.Object
  extended by m865.simulation.Event
      extended by m865.simulation.DepartmentStoreEvent
          extended by 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.


Field Summary
protected  int arrivalFloor
          floor that the elevator is at
protected  Elevator elevator
          The elevator
 
Fields inherited from class m865.simulation.DepartmentStoreEvent
departmentStore
 
Fields inherited from class m865.simulation.Event
firingTime
 
Constructor Summary
ElevatorArrivalEvent(java.lang.Integer time, DepartmentStore store, Elevator elev, int floor)
          Constructor for ElevatorArrivalEvent.
 
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 m865.simulation.Event
adjustPriority, compareTo, getFiringTime, setFiringTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

elevator

protected Elevator elevator
The elevator


arrivalFloor

protected int arrivalFloor
floor that the elevator is at

Constructor Detail

ElevatorArrivalEvent

public ElevatorArrivalEvent(java.lang.Integer time,
                            DepartmentStore store,
                            Elevator elev,
                            int floor)
Constructor for ElevatorArrivalEvent.
  1. time - The firing time of this event.
  2. departmentStore - The departmentStore that owns this event.
  3. elevator - The elevator associated with this event.
Method Detail

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
  1. If passengers inside the elevator want to get off at the arrivalFloor, the elevator will stop at this floor. Schedule an OffLoadEvent.
  2. 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.
  3. If the elevator is empty, call ButtonSystemOffArrivalFloor. The elevator will continue moving Schedule a MoveOnEvent.
  4. 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