Class SimulatedLinkingResource

java.lang.Object
de.uka.ipd.sdq.simulation.abstractsimengine.SimulationElement
de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator
All Implemented Interfaces:
de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor, IResourceDemandModifiable, de.uka.ipd.sdq.simulation.abstractsimengine.IEntity

public class SimulatedLinkingResource extends AbstractScheduledResource
Realizes a LinkingResource. Adds the latency time to the passed demand in #consumeResource(SimuComSimProcess, double), and they is loaded by latency + demand / throughput.
  • Constructor Details

    • SimulatedLinkingResource

      public SimulatedLinkingResource(org.palladiosimulator.pcm.resourceenvironment.LinkingResource linkingResource, SimuComModel simuComModel, String resourceContainerID)
  • Method Details

    • getId

      public String getId()
    • createActiveResource

      protected de.uka.ipd.sdq.scheduler.IActiveResource createActiveResource(SimuComModel simuComModel)
      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
    • 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 class AbstractScheduledResource
    • getRemainingDemandForProcess

      public double getRemainingDemandForProcess(SimuComSimProcess thread)
      Specified by:
      getRemainingDemandForProcess in class AbstractScheduledResource
    • updateDemand

      public void updateDemand(SimuComSimProcess thread, double demand)
      Specified by:
      updateDemand in class AbstractScheduledResource
    • getScheduledResource

      public de.uka.ipd.sdq.scheduler.IActiveResource getScheduledResource()
      Specified by:
      getScheduledResource in class AbstractScheduledResource
    • 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 class AbstractScheduledResource
    • deactivateResource

      public void deactivateResource()
      Description copied from class: AbstractScheduledResource
      Called by the framework to inform the resource that the simulation has been stopped. Fires a IStateListener#stateChanged() event.
      Overrides:
      deactivateResource in class AbstractScheduledResource
    • getNextResourceId

      public static String getNextResourceId()
    • getLinkingResource

      public org.palladiosimulator.pcm.resourceenvironment.LinkingResource getLinkingResource()
    • setThroughput

      public void setThroughput(String throughput)
      Change the linking resource throughput after its creation.
      Parameters:
      throughput - the new throughput specification
    • setLatency

      public void setLatency(String latency)
      Change the linking resource latency after its creation.
      Parameters:
      latency - the new latency specification