public abstract class Reportable extends ModelComponent
Constructor and Description |
---|
Reportable(Model owner,
java.lang.String name,
boolean showInReport,
boolean showInTrace)
Creates a reportable object with all parameters required.
|
Modifier and Type | Method and Description |
---|---|
Schedulable |
getCorrespondingSchedulable()
Gets the schedulable (e.g. entity) corresponding to this reportable;
may be null if no schedulable corresponds to this reportable.
|
java.lang.String |
getDescription()
Get an optional description of reported value.
|
long |
getObservations()
Returns the number of observations made by the reportable object.
|
Reporter |
getReporter()
Returns an instance of a reporter for this reportable.
|
void |
incrementObservations()
Increments the number of observations made by this reportable by one (1).
|
void |
incrementObservations(long multiObservations)
Increments the number of observations by the amount given as parameter.
|
boolean |
reportIsOn()
Checks if this reportable produces a report.
|
void |
reportOff()
Switches report mode to prevent this reportable to produce reports.
|
void |
reportOn()
Switches report mode of this reportable on to produce a report.
|
void |
reset()
Resets the counter for observations made by this reportable.
|
TimeInstant |
resetAt()
Shows the point in simulation time when the last reset of this reportable
was made.
|
void |
setCorrespondingSchedulable(Schedulable correspondingSchedulable)
Sets the schedulable (e.g. entity) corresponding to this Reportable.
|
void |
setDescription(java.lang.String description)
Set an optional description of reported value.
|
void |
setReporter(java.lang.Class<? extends Reporter> reporterClass)
Specifies a Reporter-Class to be used as reporter by this reportable.
|
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 Reportable(Model owner, java.lang.String name, boolean showInReport, boolean showInTrace)
name
- java.lang.String : The name of this reportableowner
- Model : The model this reportable is associated toshowInReport
- 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 final Reporter getReporter()
createDefaultReporter()
.
The reporter returned by this method is such a default reporter.public void setReporter(java.lang.Class<? extends Reporter> reporterClass)
createDefaultReporter()
will be used.reporterClass
- the reporter's classpublic long getObservations()
public void incrementObservations()
public void incrementObservations(long multiObservations)
multiObservations
- long : The number to increase the number of observations bypublic boolean reportIsOn()
public void reportOff()
public void reportOn()
public void reset()
resetAt()
.public TimeInstant resetAt()
public Schedulable getCorrespondingSchedulable()
public void setCorrespondingSchedulable(Schedulable correspondingSchedulable)
correspondingSchedulable
- Schedulable : The Schedulable corresponding to this Reportable.public void setDescription(java.lang.String description)
description
- public java.lang.String getDescription()