edu.rit.sim
Class Event
- java.lang.Object
-
- edu.rit.sim.Event
-
public abstract class Event extends java.lang.ObjectClass Event is the abstract base class for an event in a discrete event simulation.
-
-
Constructor Summary
Constructors Constructor and Description Event()Construct a new event.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voiddoAfter(double dt, Event event)Schedule the given event to be performed at a time dt in the future (at current simulation time + dt) in this event's simulation.voiddoAt(double t, Event event)Schedule the given event to be performed at the given time in this event's simulation.abstract voidperform()Perform this event.Simulationsimulation()Returns the simulation in which this event occurs.doubletime()Returns this event's simulation time, the time when this event is scheduled to take place.
-
-
-
Method Detail
-
simulation
public final Simulation simulation()
Returns the simulation in which this event occurs.- Returns:
- Simulation.
-
time
public final double time()
Returns this event's simulation time, the time when this event is scheduled to take place.- Returns:
- Simulation time.
-
doAt
public final void doAt(double t, Event event)Schedule the given event to be performed at the given time in this event's simulation.- Parameters:
t- Simulation time for event.event- Event to be performed.- Throws:
java.lang.IllegalArgumentException- (unchecked exception) Thrown if t is less than the current simulation time.java.lang.NullPointerException- (unchecked exception) Thrown if event is null.
-
doAfter
public final void doAfter(double dt, Event event)Schedule the given event to be performed at a time dt in the future (at current simulation time + dt) in this event's simulation.- Parameters:
dt- Simulation time delta for event.event- Event to be performed.- Throws:
java.lang.IllegalArgumentException- (unchecked exception) Thrown if dt is less than zero.java.lang.NullPointerException- (unchecked exception) Thrown if event is null.
-
perform
public abstract void perform()
Perform this event. Called by the Simulation when the simulation time equals the time when this event is scheduled to take place.
-
-
DMelt 3.0 © DataMelt by jWork.ORG