m865.simulation
Class LoadEvent
java.lang.Object
m865.simulation.Event
m865.simulation.DepartmentStoreEvent
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.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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.
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.