public abstract class ComplexSimProcess extends SimProcess
ComplexSimProcess
is a SimProcess
which
serves as a container for other SimProcess
es. A
ComplexSimProcess
has its own lifecycle. As long as this
ComplexSimProcess
is active all its contained Simprocesses are
passive. That means they are blocked and can not proceed in their lifeCycles.Constructor and Description |
---|
ComplexSimProcess(Model owner,
java.lang.String name,
boolean showInTrace)
Constructs a ComplexSimProcess.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(SimProcess compnt)
Adds a SimProcess as a component to this ComplexSimProcess.
|
boolean |
contains(SimProcess elem)
Checks if the given SimProcess is contained in this ComplexSimProcess
already.
|
java.util.Enumeration<SimProcess> |
getComponents()
Returns all the components of this ComplexSimProcess as an
java.util.Enumeration . |
boolean |
hasComponents()
Checks if this ComplexSimProcess has components or not.
|
abstract void |
lifeCycle()
Override this method in a subclass of
ComplexSimProcess to
implement the specific behaviour of this process. |
void |
removeAllComponents()
Removes all elements (SimProcesses and ComplexSimProcesses) from this
ComplexSimProcess.
|
void |
removeComponent(SimProcess elem)
Removes a SimProcess from the elements of this ComplexSimProcess.
|
java.lang.String |
toString()
Returns a
String representation of this ComplexSimProcess,
containing the String representation of each
SimProcess component. |
activate, activate, activate, activateAfter, activateBefore, activatePreempt, cancelInterruptDelayed, canCooperate, clearInterruptCode, cooperate, getActivatedBy, getInterruptCode, getInterruptException, getMaster, getRealTimeConstraint, getSchedulingPriority, getSlaveWaitQueue, getSupervisor, hold, hold, hold, interrupt, interrupt, interruptDelayed, interruptDelayed, isBlocked, isComponent, isDelayedInterruptScheduled, isInterrupted, isRepeating, isTerminated, obtainResources, passivate, prepareTransport, reActivate, reActivate, resetMaster, returnAllResources, returnResources, setBlocked, setRealTimeConstraint, setRepeating, setSchedulingPriority, setSlaveWaitQueue
getIdentNumber, getQueueingPriority, getQueues, getScheduledEvents, isEqual, isLarger, isLargerOrEqual, isNotEqual, isQueued, isSimProcess, isSmaller, isSmallerOrEqual, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, scheduleAfter, scheduleAfter, scheduleAfter, scheduleBefore, scheduleBefore, scheduleBefore, schedulePreempt, schedulePreempt, schedulePreempt, setQueueingPriority
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
public ComplexSimProcess(Model owner, java.lang.String name, boolean showInTrace)
owner
- desmoj.Model : The model this ComplexSimProcess is associated
to.name
- java.lang.String : The name of this ComplexSimProcess.showInTrace
- boolean : Flag for showing trace messages of this
ComplexSimProcess in trace-files. Set it to true
if ComplexSimProcess should show up in trace. Set it to
false
if ComplexSimProcess should not be shown
in trace.public void addComponent(SimProcess compnt) throws SuspendExecution
removeComponent()
to remove the
Sim-process from the ComplexSimProcess again.compnt
- desmoj.SimProcess : The SimProcess to be added as a component
to this ComplexSimProcess.SuspendExecution
public boolean contains(SimProcess elem)
elem
- desmoj.SimProcess : The SimProcess which might be an element
of this ComplexSimPorcess already.true
if and only if the specified
SimProcess is the same as a component in this ComplexSimProcess,
as determined by the equals()
method;
false
otherwise.Vector
public java.util.Enumeration<SimProcess> getComponents()
java.util.Enumeration
.Enumeration
public boolean hasComponents()
true
if and only if this
ComplexSimProcess has components; false
otherwise.public abstract void lifeCycle() throws co.paralleluniverse.fibers.SuspendExecution
ComplexSimProcess
to
implement the specific behaviour of this process. This method starts
after a ComplexSimProcess
has been created and activated
by the scheduler. As long as this ComplexSimProcess
is
active all its contained Simprocesses are passive. That means they are
blocked and can not proceed in their lifeCycles.lifeCycle
in class SimProcess
co.paralleluniverse.fibers.SuspendExecution
public void removeAllComponents()
public void removeComponent(SimProcess elem)
elem
- desmoj.SimProcess : The SimProcess to be removed from the
elements of this ComplexSimProcess. Be careful, it might also
be a ComplexSimProcess
.public java.lang.String toString()
String
representation of this ComplexSimProcess,
containing the String
representation of each
SimProcess
component.toString
in class NamedObject
String
representation of this
ComplexSimProcess.