public class Schedulable extends ModelComponent
Constructor and Description |
---|
Schedulable(Model owner,
java.lang.String name,
boolean showInTrace)
Constructs a Schedulable object with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
assignReporter(java.lang.Class<? extends Reporter> reporterClass,
boolean showInReport,
boolean showInTrace)
Allows to allocate a
Reporter to this Schedulable . |
void |
cancel()
Removes all events scheduled for this entity from the event-list.
|
Reportable |
getCorrespondingReportable()
Gets the Reportable corresponding to this Schedulable;
may be null if no Reportable corresponds to this Schedulable.
|
boolean |
isCurrent()
Shows if this Schedulable is the currently active object.
|
boolean |
isScheduled()
Tests if this entity has already been scheduled.
|
void |
rename(java.lang.String newName)
Allows to rename a Schedulable object while keeping its internally added
serial number to keep track of the individual object.
|
void |
reSchedule(TimeInstant time)
Re-schedules the Schedulable to some other point in simulation time
(which should be different form the instant at which is a scheduled
at the moment).
|
void |
reSchedule(TimeSpan dt)
Re-schedules the Schedulable by shifting all EventNote by a specified
TimeSpan . |
void |
reSchedulePreempt()
Re-schedules the Schedulable to happen immediately, preempting
the current process.
|
TimeInstant |
scheduledNext()
Returns the next point of time this entity is scheduled.
|
void |
setCorrespondingReportable(Reportable correspondingReportable)
Sets the Reportable (e.g. entity) corresponding to this Schedulable.
|
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 Schedulable(Model owner, java.lang.String name, boolean showInTrace)
name
- java.lang.String : The name of the new Schedulable objectowner
- Model : The owner of this Schedulable objectpublic void cancel()
public boolean isCurrent()
true
if this Schedulable is the currently
active, false
otherwisepublic boolean isScheduled()
true
if already scheduled,
false
otherwisepublic void rename(java.lang.String newName)
newName
- java.lang.String : The Schedulable's new namepublic void reSchedule(TimeSpan dt)
TimeSpan
.dt
- TimeSpan : The offset to the current simulation time at which
this Schedulable is to be re-scheduledpublic void reSchedule(TimeInstant time) throws SuspendExecution
time
- TimeInstant : The simulation time at which
this entity is to be re-scheduledSuspendExecution
public void reSchedulePreempt() throws SuspendExecution
SuspendExecution
public TimeInstant scheduledNext()
null
otherwisepublic void assignReporter(java.lang.Class<? extends Reporter> reporterClass, boolean showInReport, boolean showInTrace)
Reporter
to this Schedulable
.
Bypassing the usual approach of each ModelComponent
either being
a Schedulable
or a Reportable
, this allocation
permits generating report output about a ModelComponent
that is
also used for scheduling. Internally, a dummy Reportable
is generated,
strictly speaking (hidden from the user) is the true Reportable
to report about.r
- Reporter : The offset to the current simulation time at which
this Schedulable is to be re-scheduled.
Must have a constructor accepting a Schedulable
as only (!) parameter.showInReport
- boolean : Flag for showing the report. Set it to
true
if reportable should show up in report.
Set it to false
if reportable should not be
shown in report.showInTrace
- boolean : Flag for showing this reportable in trace files. Set
it to true
if reportable should show up in
trace. Set it to false
if reportable should not
be shown in trace.public Reportable getCorrespondingReportable()
public void setCorrespondingReportable(Reportable correspondingReportable)
correspondingReportable
- Reportable : The Reportable corresponding to this Schedulable.