input
Class ScheduledUpdatesQueue

java.lang.Object
  extended by input.ScheduledUpdatesQueue
All Implemented Interfaces:
EventQueue

public class ScheduledUpdatesQueue
extends java.lang.Object
implements EventQueue

Event queue where simulation objects can request an update to happen at the specified simulation time. Multiple updates at the same time are merged to a single update.


Constructor Summary
ScheduledUpdatesQueue()
          Constructor.
 
Method Summary
 void addUpdate(double simTime)
          Add a new update request for the given time
 ExternalEvent nextEvent()
          Returns the next scheduled event or event with time Double.MAX_VALUE if there aren't any.
 double nextEventsTime()
          Returns the next scheduled event's time or Double.MAX_VALUE if there aren't any events left
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScheduledUpdatesQueue

public ScheduledUpdatesQueue()
Constructor. Creates an empty update queue.

Method Detail

nextEvent

public ExternalEvent nextEvent()
Returns the next scheduled event or event with time Double.MAX_VALUE if there aren't any.

Specified by:
nextEvent in interface EventQueue
Returns:
the next scheduled event

nextEventsTime

public double nextEventsTime()
Returns the next scheduled event's time or Double.MAX_VALUE if there aren't any events left

Specified by:
nextEventsTime in interface EventQueue
Returns:
the next scheduled event's time

addUpdate

public void addUpdate(double simTime)
Add a new update request for the given time

Parameters:
simTime - The time when the update should happen

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object