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, setAvailablegetModelgetEncapsulatedEntity, isScheduled, reschedulegetNamepublic ScheduledResource(org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification activeResource,
SimuComModel myModel,
String resourceContainerID,
String schedulingStrategyID)
public void activateResource()
AbstractScheduledResourceactivateResource in class AbstractScheduledResourcepublic void consumeResource(SimuComSimProcess process, int resourceServiceID, Map<String,Serializable> parameterMap, double abstractDemand)
AbstractScheduledResourceconsumeResource in class AbstractScheduledResourceprocess - 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 AbstractScheduledResourcepublic void updateDemand(SimuComSimProcess thread, double demand)
updateDemand in class AbstractScheduledResourcepublic void deactivateResource()
AbstractScheduledResourceIStateListener#stateChanged() event.deactivateResource in class AbstractScheduledResourcepublic static String getNextResourceId()
public IActiveResource getScheduledResource()
getScheduledResource in class AbstractScheduledResourcepublic 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)
IActiveResourceStateSensorupdate in interface IActiveResourceStateSensorupdate in class AbstractScheduledResourcestate - the changed stateinstanceId - id of the instance whose state changed