Class User
- 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.workload.entities.User
-
- All Implemented Interfaces:
de.uka.ipd.sdq.simulation.abstractsimengine.IEntity
,IUser
public class User extends EventSimEntity implements IUser
This entity represents a user of the system under simulation. Users issue system calls while traversing a usage scenario. They are spawned by aWorkloadGenerator
.- See Also:
EventSimEntity
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.kit.ipd.sdq.eventsim.entities.EventSimEntity
EventSimEntity.EntityLifecyclePhase
-
-
Constructor Summary
Constructors Constructor Description User(de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationModel model, org.palladiosimulator.pcm.usagemodel.UsageScenario scenario)
Constructs a new User that is supposed to traverse the specified usage scenario.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delay(double waitingTime, Procedure onResumeCallback)
void
enterScenarioBehaviour(org.palladiosimulator.pcm.usagemodel.ScenarioBehaviour behaviour, Procedure onFinishCallback)
String
getId()
de.uka.ipd.sdq.simucomframework.variables.StackContext
getStochasticExpressionContext()
org.palladiosimulator.pcm.usagemodel.UsageScenario
getUsageScenario()
Returns the usage scenario that is to be executed by this User.EntityState<org.palladiosimulator.pcm.usagemodel.AbstractUserAction>
getUserState()
void
leaveScenarioBehaviour()
void
notifyEnteredSystem()
Notifies all registered listeners as well as theEventSimModel
that the entity is about to enter the system.void
notifyLeftSystem()
Notifies all registered listeners as well as theEventSimModel
that the entity has left the system.void
simulateAction(org.palladiosimulator.pcm.usagemodel.AbstractUserAction action)
void
simulateBehaviour(org.palladiosimulator.pcm.usagemodel.ScenarioBehaviour behaviour, Procedure onCompletionCallback)
Simulates the givenbehaviour
by simulating the nested chain of actions.-
Methods inherited from class edu.kit.ipd.sdq.eventsim.entities.EventSimEntity
addEntityListener, equals, getEntityId, getLifecyclePhase, getName, hashCode, removeEntityListener, resetIdGenerator, toString
-
-
-
-
Constructor Detail
-
User
@Inject public User(de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationModel model, org.palladiosimulator.pcm.usagemodel.UsageScenario scenario)
Constructs a new User that is supposed to traverse the specified usage scenario.- Parameters:
model
- the simulation modelscenario
- the usage scenario
-
-
Method Detail
-
getId
public String getId()
-
getUsageScenario
public org.palladiosimulator.pcm.usagemodel.UsageScenario getUsageScenario()
Returns the usage scenario that is to be executed by this User.- Specified by:
getUsageScenario
in interfaceIUser
- Returns:
- the usage scenario
-
getUserState
public EntityState<org.palladiosimulator.pcm.usagemodel.AbstractUserAction> getUserState()
-
getStochasticExpressionContext
public de.uka.ipd.sdq.simucomframework.variables.StackContext getStochasticExpressionContext()
- Specified by:
getStochasticExpressionContext
in interfaceIUser
-
enterScenarioBehaviour
public void enterScenarioBehaviour(org.palladiosimulator.pcm.usagemodel.ScenarioBehaviour behaviour, Procedure onFinishCallback)
-
leaveScenarioBehaviour
public void leaveScenarioBehaviour()
-
delay
public void delay(double waitingTime, Procedure onResumeCallback)
-
simulateAction
public void simulateAction(org.palladiosimulator.pcm.usagemodel.AbstractUserAction action)
-
simulateBehaviour
public void simulateBehaviour(org.palladiosimulator.pcm.usagemodel.ScenarioBehaviour behaviour, Procedure onCompletionCallback)
Simulates the givenbehaviour
by simulating the nested chain of actions. If these actions contain furtherScenarioBehaviour
s, these are simulated as well (and so on, recursively).Once the entire behaviour has been simulated, the given
callback
will be invoked.When this method returns, there is no guarantee whether the behaviour has been simulated or not.
- Parameters:
behaviour
- the behaviour to be simulatedonCompletionCallback
- will be invoked once the behaviour has been simulated completely
-
notifyEnteredSystem
public void notifyEnteredSystem()
Description copied from class:EventSimEntity
Notifies all registered listeners as well as theEventSimModel
that the entity is about to enter the system.- Overrides:
notifyEnteredSystem
in classEventSimEntity
-
notifyLeftSystem
public void notifyLeftSystem()
Description copied from class:EventSimEntity
Notifies all registered listeners as well as theEventSimModel
that the entity has left the system.- Overrides:
notifyLeftSystem
in classEventSimEntity
-
-