m865.simulation
Class LoadEvent

java.lang.Object
  extended by m865.simulation.Event
      extended by m865.simulation.DepartmentStoreEvent
          extended by m865.simulation.LoadEvent
All Implemented Interfaces:
java.lang.Comparable, Prioritizeable

public class LoadEvent
extends DepartmentStoreEvent

The LoadEvent is responsible for moving passengers from a waiting queue onto an elevator, provided the elevator is stopping at the floor the passenger is on and is travelling in the direction the passenger wants to go.


Field Summary
 
Fields inherited from class m865.simulation.DepartmentStoreEvent
departmentStore
 
Fields inherited from class m865.simulation.Event
firingTime
 
Constructor Summary
LoadEvent(java.lang.Integer time, DepartmentStore deptStore, Elevator elevator, BalkingQueue queue)
          Create a new LoadEvent for moving passengers from the given queue to the given elevator.
 
Method Summary
 void fire()
          Fire the event; move passengers onto the elevator and schedule schedule a MoveOnEvent after all passengers are on the elevator.
 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
 

Constructor Detail

LoadEvent

public LoadEvent(java.lang.Integer time,
                 DepartmentStore deptStore,
                 Elevator elevator,
                 BalkingQueue queue)
Create a new LoadEvent for moving passengers from the given queue to the given elevator.

Parameters:
time - The firing time.
deptStore - The department store we're in.
elevator - The elevator to move passengs to.
queue - The queue to move passengers from.
Method Detail

fire

public void fire()
Fire the event; move passengers onto the elevator and schedule schedule a MoveOnEvent after all passengers are on the elevator.

Specified by:
fire in class Event

toString

public java.lang.String toString()
Description copied from class: Event
The basic toString method

Overrides:
toString in class Event
Returns:
a string identifying this event.