public class ScheduledResource extends AbstractScheduledResource
Constructor and Description |
---|
ScheduledResource(org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification activeResource,
SimuComModel myModel,
String resourceContainerID,
String schedulingStrategyID) |
Modifier and Type | Method and Description |
---|---|
void |
activateResource()
Called by the framework to inform that the resource should start its lifecycle
|
void |
consumeResource(SimuComSimProcess process,
int resourceServiceID,
Map<String,Serializable> parameterMap,
double abstractDemand)
Called by client of this resource to make the resource simulate resource processing.
|
void |
deactivateResource()
Called by the framework to inform the resource that the simulation has been stopped.
|
org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification |
getActiveResource() |
double |
getFailureTime()
Returns the failure time for this resource (or -1.0 if the resource cannot fail).
|
static String |
getNextResourceId() |
double |
getRemainingDemandForProcess(SimuComSimProcess thread) |
double |
getRepairTime()
Returns the repair time for this resource (or -1.0 if the resource cannot fail).
|
IActiveResource |
getScheduledResource() |
void |
setProcessingRate(String newProcessingRate)
Method to alter processing rate at runtime, e.g., to model changing parameters of cloud
environments at runtime
|
void |
update(long state,
int instanceId)
Notifies the sensor about a state change of the resource.
|
void |
updateDemand(SimuComSimProcess thread,
double demand) |
addDemandListener, addOverallUtilizationListener, addStateListener, demandCompleted, getDescription, getNumberOfInstances, getQueueLength, getResourceTypeId, getSchedulingStrategyID, getUnderlyingResource, isAvailable, isRequiredByContainer, setAvailable
getModel
getEncapsulatedEntity, isScheduled, reschedule
getName
public ScheduledResource(org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification activeResource, SimuComModel myModel, String resourceContainerID, String schedulingStrategyID)
public void activateResource()
AbstractScheduledResource
activateResource
in class AbstractScheduledResource
public void consumeResource(SimuComSimProcess process, int resourceServiceID, Map<String,Serializable> parameterMap, double abstractDemand)
AbstractScheduledResource
consumeResource
in class AbstractScheduledResource
process
- The thread or job requesting the processing of its demandresourceServiceID
- The id of the resource service to be called for resource consumptionparameterMap
- Additional parameters which can be used by the resource. Map can be empty.abstractDemand
- The resource demand the client wishes to be processed by the resourcepublic double getRemainingDemandForProcess(SimuComSimProcess thread)
getRemainingDemandForProcess
in class AbstractScheduledResource
public void updateDemand(SimuComSimProcess thread, double demand)
updateDemand
in class AbstractScheduledResource
public void deactivateResource()
AbstractScheduledResource
IStateListener#stateChanged()
event.deactivateResource
in class AbstractScheduledResource
public static String getNextResourceId()
public IActiveResource getScheduledResource()
getScheduledResource
in class AbstractScheduledResource
public void setProcessingRate(String newProcessingRate)
newProcessingRate
- The new processing rate of this resourcepublic org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification getActiveResource()
public double getFailureTime()
public double getRepairTime()
public void update(long state, int instanceId)
IActiveResourceStateSensor
update
in interface IActiveResourceStateSensor
update
in class AbstractScheduledResource
state
- the changed stateinstanceId
- id of the instance whose state changed