|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.simevents.Event
umontreal.iro.lecuyer.contactcenters.SwitchEvent
public class SwitchEvent
Represents an event that toggles an element on predefined simulation times.
This differs from ToggleEvent
that occurs only at a specific
simulation time, and enables or disables the toggle element once. This event
is constructed with a toggle element, and an array of simulation times. The
constructors determines the first time, in the array, that is greater than
the current simulation time, and schedules the event at that time. When the
event happens, the element is toggled, and the event is scheduled again until
all the times in the array have been used.
Field Summary |
---|
Fields inherited from class umontreal.iro.lecuyer.simevents.Event |
---|
eventTime, priority, sim |
Constructor Summary | |
---|---|
SwitchEvent(Simulator sim,
ToggleElement el,
double[] times)
Equivalent to SwitchEvent(ToggleElement,double[]) ,
with a user-defined simulator sim. |
|
SwitchEvent(ToggleElement el,
double[] times)
Constructs a new switch event from the toggle element el, and the simulation times times. |
Method Summary | |
---|---|
void |
actions()
|
double |
getNextTime()
|
int |
getNextTimeIndex()
|
ToggleElement |
getToggleElement()
Returns the toggle element affected with this event. |
double[] |
getToggleTimes()
Returns an array containing the toggle times used by this event. |
void |
init()
|
void |
schedule()
|
void |
skipTime()
Cancels this event if it is scheduled, and skips to the next toggle time. |
String |
toString()
|
Methods inherited from class umontreal.iro.lecuyer.simevents.Event |
---|
cancel, cancel, compareTo, getRa, priority, reschedule, schedule, scheduleAfter, scheduleBefore, scheduleNext, setPriority, setRa, setSimulator, setTime, simulator, time |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SwitchEvent(ToggleElement el, double[] times)
el
- the toggle element.times
- the simulation times the event will occur.
NullPointerException
- if el or times are null.public SwitchEvent(Simulator sim, ToggleElement el, double[] times)
SwitchEvent(ToggleElement,double[])
,
with a user-defined simulator sim.
sim
- the simulator attached to the new event.el
- the toggle element.times
- the simulation times the event will occur.
NullPointerException
- if sim, el, or times are null.Method Detail |
---|
public ToggleElement getToggleElement()
public double[] getToggleTimes()
public void init()
public int getNextTimeIndex()
public double getNextTime()
public void schedule()
public void skipTime()
public void actions()
actions
in class Event
public String toString()
toString
in class Object
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |