Class SimulatedProcess
- java.lang.Object
-
- de.uka.ipd.sdq.simulation.abstractsimengine.SimulationElement
-
- de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator
-
- edu.kit.ipd.sdq.eventsim.entities.EventSimEntity
-
- edu.kit.ipd.sdq.eventsim.resources.entities.SimulatedProcess
-
- All Implemented Interfaces:
de.uka.ipd.sdq.scheduler.ISchedulableProcess
,de.uka.ipd.sdq.simulation.abstractsimengine.IEntity
public class SimulatedProcess extends EventSimEntity implements de.uka.ipd.sdq.scheduler.ISchedulableProcess
A simulated process is a process that can be scheduled on an active or passive resource. Whenever the scheduler activates or passivates the process, theIProcessListener
, which has been passed to the constructor, gets notified.- See Also:
ISchedulableProcess
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.kit.ipd.sdq.eventsim.entities.EventSimEntity
EventSimEntity.EntityLifecyclePhase
-
-
Constructor Summary
Constructors Constructor Description SimulatedProcess(de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationModel model, SimulatedProcess parent, IRequest request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate()
void
addTerminatedObserver(de.uka.ipd.sdq.scheduler.IActiveResource o)
Adds an observer which gets notifies when the process has ended its execution.void
fireTerminated()
Notifies the observers which have been registered viaaddTerminatedObserver(IActiveResource)
that the process has ended it execution.org.palladiosimulator.pcm.seff.AbstractAction
getCurrentPosition()
String
getId()
String
getName()
Returns the name of this entity.SimulatedProcess
getParent()
int
getPriority()
IRequest
getRequest()
Returns the request that created this simulated process.de.uka.ipd.sdq.scheduler.ISchedulableProcess
getRootProcess()
boolean
isFinished()
void
passivate()
void
removeTerminatedObserver(de.uka.ipd.sdq.scheduler.IActiveResource o)
Removes the specified resource from the observer list.void
setOnActivationCallback(Procedure callback)
void
setPriority(int priority)
void
terminate()
Terminates this simulated process.void
timeout(String timeoutFailureName)
-
Methods inherited from class edu.kit.ipd.sdq.eventsim.entities.EventSimEntity
addEntityListener, equals, getEntityId, getLifecyclePhase, hashCode, notifyEnteredSystem, notifyLeftSystem, removeEntityListener, resetIdGenerator, toString
-
Methods inherited from class de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator
getEncapsulatedEntity, isScheduled, reschedule
-
-
-
-
Constructor Detail
-
SimulatedProcess
public SimulatedProcess(de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationModel model, SimulatedProcess parent, IRequest request)
-
-
Method Detail
-
setOnActivationCallback
public void setOnActivationCallback(Procedure callback)
-
activate
public void activate()
- Specified by:
activate
in interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
passivate
public void passivate()
- Specified by:
passivate
in interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
getId
public String getId()
- Specified by:
getId
in interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
getRootProcess
public de.uka.ipd.sdq.scheduler.ISchedulableProcess getRootProcess()
- Specified by:
getRootProcess
in interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
getRequest
public IRequest getRequest()
Returns the request that created this simulated process.
-
getParent
public SimulatedProcess getParent()
-
isFinished
public boolean isFinished()
- Specified by:
isFinished
in interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
terminate
public void terminate()
Terminates this simulated process. Notifies all observers that has been registered by theaddTerminatedObserver
method.If this simulated process terminated already, calling this method has no effect.
-
getPriority
public int getPriority()
- Specified by:
getPriority
in interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
setPriority
public void setPriority(int priority)
- Specified by:
setPriority
in interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
addTerminatedObserver
public void addTerminatedObserver(de.uka.ipd.sdq.scheduler.IActiveResource o)
Adds an observer which gets notifies when the process has ended its execution.- Specified by:
addTerminatedObserver
in interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
fireTerminated
public void fireTerminated()
Notifies the observers which have been registered viaaddTerminatedObserver(IActiveResource)
that the process has ended it execution. This is automatically done, whenterminate()
method is being invoked.- Specified by:
fireTerminated
in interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
removeTerminatedObserver
public void removeTerminatedObserver(de.uka.ipd.sdq.scheduler.IActiveResource o)
Removes the specified resource from the observer list.- Specified by:
removeTerminatedObserver
in interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
timeout
public void timeout(String timeoutFailureName)
- Specified by:
timeout
in interfacede.uka.ipd.sdq.scheduler.ISchedulableProcess
-
getName
public String getName()
Description copied from class:EventSimEntity
Returns the name of this entity. The name is thenamePrefix
passed to the constructor concatenated with the entity's ID.- Overrides:
getName
in classEventSimEntity
- Returns:
- a string representation of this entity
-
getCurrentPosition
public org.palladiosimulator.pcm.seff.AbstractAction getCurrentPosition()
-
-