Class SimulatedLinkingResource
java.lang.Object
de.uka.ipd.sdq.simulation.abstractsimengine.SimulationElement
de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator
de.uka.ipd.sdq.simucomframework.entities.SimuComEntity
de.uka.ipd.sdq.simucomframework.resources.AbstractScheduledResource
de.uka.ipd.sdq.simucomframework.resources.SimulatedLinkingResource
- All Implemented Interfaces:
de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor
,IResourceDemandModifiable
,de.uka.ipd.sdq.simulation.abstractsimengine.IEntity
Realizes a LinkingResource. Adds the latency time to the passed demand in
#consumeResource(SimuComSimProcess, double)
, and they is loaded by latency + demand /
throughput.-
Field Summary
Fields inherited from class de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator
delegate
Fields inherited from interface de.uka.ipd.sdq.simulation.abstractsimengine.IEntity
NULL
-
Constructor Summary
ConstructorDescriptionSimulatedLinkingResource
(org.palladiosimulator.pcm.resourceenvironment.LinkingResource linkingResource, SimuComModel simuComModel, String resourceContainerID) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called by the framework to inform that the resource should start its lifecycleprotected void
Asserts that the resource is currently available; if not, an EnvironmentFailureException is thrown.protected double
calculateDemand
(double demand) Template method.protected de.uka.ipd.sdq.scheduler.IActiveResource
createActiveResource
(SimuComModel simuComModel) Subclasses are responsible for creating theIActiveResource
to use internally.void
Called by the framework to inform the resource that the simulation has been stopped.getId()
org.palladiosimulator.pcm.resourceenvironment.LinkingResource
static String
double
de.uka.ipd.sdq.scheduler.IActiveResource
void
setLatency
(String latency) Change the linking resource latency after its creation.void
setThroughput
(String throughput) Change the linking resource throughput after its creation.void
updateDemand
(SimuComSimProcess thread, double demand) Methods inherited from class de.uka.ipd.sdq.simucomframework.resources.AbstractScheduledResource
addDemandListener, addDemandModifyingBehavior, addOverallUtilizationListener, addStateListener, consumeResource, demandCompleted, fireDemand, fireOverallUtilization, fireStateEvent, getDescription, getNumberOfInstances, getQueueLength, getResourceTypeId, getSchedulingStrategyID, getUnderlyingResource, isAvailable, isRequiredByContainer, removeDemandModifyingBehavior, setAvailable, update
Methods inherited from class de.uka.ipd.sdq.simucomframework.entities.SimuComEntity
getModel
Methods inherited from class de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator
getEncapsulatedEntity, isScheduled, reschedule
Methods inherited from class de.uka.ipd.sdq.simulation.abstractsimengine.SimulationElement
getName
-
Constructor Details
-
SimulatedLinkingResource
public SimulatedLinkingResource(org.palladiosimulator.pcm.resourceenvironment.LinkingResource linkingResource, SimuComModel simuComModel, String resourceContainerID)
-
-
Method Details
-
getId
-
createActiveResource
Description copied from class:AbstractScheduledResource
Subclasses are responsible for creating theIActiveResource
to use internally. Is called in the constructor.- Specified by:
createActiveResource
in classAbstractScheduledResource
- Returns:
- the
IActiveResource
resource to use as determined by the subclasses.
-
calculateDemand
protected double calculateDemand(double demand) Description copied from class:AbstractScheduledResource
Template method. Implementers have to use the given demand and return the time span needed to process the demand on this resource.- Specified by:
calculateDemand
in classAbstractScheduledResource
- Parameters:
demand
- The demand issued to this resource in units understood by the resource- Returns:
- The service time, given in seconds
-
assertAvailability
protected void assertAvailability()Description copied from class:AbstractScheduledResource
Asserts that the resource is currently available; if not, an EnvironmentFailureException is thrown.- Overrides:
assertAvailability
in classAbstractScheduledResource
-
getRemainingDemandForProcess
- Specified by:
getRemainingDemandForProcess
in classAbstractScheduledResource
-
updateDemand
- Specified by:
updateDemand
in classAbstractScheduledResource
-
getScheduledResource
public de.uka.ipd.sdq.scheduler.IActiveResource getScheduledResource()- Specified by:
getScheduledResource
in classAbstractScheduledResource
-
activateResource
public void activateResource()Description copied from class:AbstractScheduledResource
Called by the framework to inform that the resource should start its lifecycle- Overrides:
activateResource
in classAbstractScheduledResource
-
deactivateResource
public void deactivateResource()Description copied from class:AbstractScheduledResource
Called by the framework to inform the resource that the simulation has been stopped. Fires aIStateListener#stateChanged()
event.- Overrides:
deactivateResource
in classAbstractScheduledResource
-
getNextResourceId
-
getLinkingResource
public org.palladiosimulator.pcm.resourceenvironment.LinkingResource getLinkingResource() -
setThroughput
Change the linking resource throughput after its creation.- Parameters:
throughput
- the new throughput specification
-
setLatency
Change the linking resource latency after its creation.- Parameters:
latency
- the new latency specification
-