Class ScheduledResource

  • All Implemented Interfaces:
    de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor, de.uka.ipd.sdq.simulation.abstractsimengine.IEntity
    Direct Known Subclasses:
    HDDResource

    public class ScheduledResource
    extends AbstractScheduledResource
    • Field Detail

      • canBeUnavailable

        protected final boolean canBeUnavailable
    • Constructor Detail

      • ScheduledResource

        public ScheduledResource​(org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification activeResource,
                                 SimuComModel myModel,
                                 String resourceContainerID,
                                 String schedulingStrategyID)
    • Method Detail

      • createActiveResource

        protected de.uka.ipd.sdq.scheduler.IActiveResource createActiveResource​(SimuComModel myModel)
        Description copied from class: AbstractScheduledResource
        Subclasses are responsible for creating the IActiveResource to use internally. Is called in the constructor.
        Specified by:
        createActiveResource in class AbstractScheduledResource
        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 class AbstractScheduledResource
        Parameters:
        demand - The demand issued to this resource in units understood by the resource
        Returns:
        The service time, given in seconds
      • consumeResource

        public void consumeResource​(SimuComSimProcess process,
                                    int resourceServiceID,
                                    Map<String,​Serializable> parameterMap,
                                    double abstractDemand)
        Description copied from class: AbstractScheduledResource
        Called by client of this resource to make the resource simulate resource processing. This is the queueing network service center part of our simulation. Allows passing of additional parameters.
        Specified by:
        consumeResource in class AbstractScheduledResource
        Parameters:
        process - The thread or job requesting the processing of its demand
        resourceServiceID - The id of the resource service to be called for resource consumption
        parameterMap - 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 resource
      • getNextResourceId

        public static String getNextResourceId()
      • setProcessingRate

        public void setProcessingRate​(String newProcessingRate)
        Method to alter processing rate at runtime, e.g., to model changing parameters of cloud environments at runtime
        Parameters:
        newProcessingRate - The new processing rate of this resource
      • getActiveResource

        public org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification getActiveResource()
      • getFailureTime

        public double getFailureTime()
        Returns the failure time for this resource (or -1.0 if the resource cannot fail).
        Returns:
        the failure time for the resource
      • getRepairTime

        public double getRepairTime()
        Returns the repair time for this resource (or -1.0 if the resource cannot fail).
        Returns:
        the repair time for the resource
      • update

        public void update​(long state,
                           int instanceId)
        Specified by:
        update in interface de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor
        Overrides:
        update in class AbstractScheduledResource