public abstract class ExternalEvent extends EventAbstract
For events specifically changing the state of up to three entities, refer
to Event
, EventOf2Entities
and EventOf3Entities
.
Events not associated to a specific entity are called external events as they
are are typically used for external influences, e.g. arrivals from outside or incidents.
Derive from this class to
design special external events for a model. To use external events, always
create a new object of this class.
Event
,
EventOf2Entities
,
EventOf3Entities
,
TimeInstant
,
TimeSpan
Constructor and Description |
---|
ExternalEvent(Model owner,
java.lang.String name,
boolean showInTrace)
Creates an external event for the given model with the given name and the
specified tracemode.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
eventRoutine()
Implement this method to express the semantics of this external event.
|
void |
schedule()
Schedules this external event to make the desired changes to the
experiment or model now.
|
void |
schedule(NumericalDist<?> dist)
Schedules this external event to make the desired changes to the
experiment or model.
|
void |
schedule(TimeInstant when)
Schedules this external event to make the desired changes to the
experiment or model at the specified point in simulation time.
|
void |
schedule(TimeSpan dt)
Schedules this external event to make the desired changes to the
experiment or model at the current point of time plus the given span of
time.
|
void |
scheduleAfter(Schedulable after)
Schedules this external event to act on the experiment or model state
directly after the given Schedulable is already set to be activated.
|
void |
scheduleBefore(Schedulable before)
Schedules this external event to act on the experiment or model state
directly before the given Schedulable is already set to be activated.
|
void |
schedulePreempt()
Schedules this event to be executed immediately, preempting the
process lifecycle executed at the moment.
|
getNumberOfEntities, getRealTimeConstraint, getSchedulingPriority, isExternal, setRealTimeConstraint, setSchedulingPriority
assignReporter, cancel, getCorrespondingReportable, isCurrent, isScheduled, rename, reSchedule, reSchedule, reSchedulePreempt, scheduledNext, setCorrespondingReportable
current, currentEntity, currentEntityAll, currentEvent, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
getName, getQuotedName, toString
public ExternalEvent(Model owner, java.lang.String name, boolean showInTrace)
owner
- Model : The external event's modelname
- java.lang.String : The external event's nameshowInTrace
- boolean : Flag for showing this external event in
tracemessagespublic abstract void eventRoutine() throws SuspendExecution
eventRoutine(Entity who)
of class Event
).
Override this method to implement this Externalevent's behaviour.SuspendExecution
public void schedule(TimeSpan dt)
dt
- TimeSpan : The offset to the current simulation time at which
this external event is to be scheduledSimClock
public void schedule()
SimClock
public void schedulePreempt() throws SuspendExecution
SuspendExecution
public void schedule(NumericalDist<?> dist)
dist
- NumericalDist> : Numerical distribution to sample the
offset to the current simulation time fromSimClock
public void schedule(TimeInstant when)
when
- TimeInstant : The point in simulation time this external event
is scheduled to happen.SimClock
public void scheduleAfter(Schedulable after)
after
- Schedulable : The Schedulable this external event should be
scheduled afterpublic void scheduleBefore(Schedulable before)
before
- Schedulable : The Schedulable this external event should be
scheduled before