|
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.ToggleEvent
public class ToggleEvent
This event instructs a toggle element, i.e., any object implementing
ToggleElement
, to be started or stopped during the simulation. It
can be useful to toggle some elements of a contact center, e.g.,
arrival processes, at determined moments during simulation. After the event
is constructed and scheduled, when the simulation clock reaches the scheduled
time, the event starts or stops the associated toggle element. Note that
for the event to have a meaningful name when printing the event list, the
target toggle element should override its toString method.
Field Summary |
---|
Fields inherited from class umontreal.iro.lecuyer.simevents.Event |
---|
eventTime, priority, sim |
Constructor Summary | |
---|---|
ToggleEvent(Simulator sim,
ToggleElement element,
boolean start)
Equivalent to ToggleEvent(ToggleElement,boolean) ,
with a user-defined simulator sim. |
|
ToggleEvent(ToggleElement element,
boolean start)
Constructs a new toggle event that will, at the time of its execution, start the toggle element element if start is true, or stop it if enabled is false. |
Method Summary | |
---|---|
void |
actions()
|
boolean |
getStart()
Returns the status of the toggle element associated with this object after this event has occurred. |
ToggleElement |
getToggleElement()
Returns the toggle element affected by this event. |
void |
setStart(boolean start)
When the event occurs, the activity status of the toggle element will be set to start. |
void |
setToggleElement(ToggleElement element)
Changes the associated toggle element to element. |
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 ToggleEvent(ToggleElement element, boolean start)
element
- the toggle element affected by the event.start
- the status of the toggle element after the event occurs.
NullPointerException
- if element is null.public ToggleEvent(Simulator sim, ToggleElement element, boolean start)
ToggleEvent(ToggleElement,boolean)
,
with a user-defined simulator sim.
sim
- the simulator associated with the toggle event.element
- the toggle element affected by the event.start
- the status of the toggle element after the event occurs.
NullPointerException
- if sim or element are null.Method Detail |
---|
public ToggleElement getToggleElement()
public void setToggleElement(ToggleElement element)
element
- the new toggle element.
NullPointerException
- if element is null.public boolean getStart()
public void setStart(boolean start)
start
- true if the toggle element will be started,
false if it will be stopped.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 |