java.lang.Object
de.uka.ipd.sdq.simulation.abstractsimengine.SimulationElement
de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator
de.uka.ipd.sdq.scheduler.entities.SchedulerEntity
edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.resources.active.SimResourceInstance
All Implemented Interfaces:
de.uka.ipd.sdq.simulation.abstractsimengine.IEntity, IResourceInstance

public class SimResourceInstance extends de.uka.ipd.sdq.scheduler.entities.SchedulerEntity implements IResourceInstance
  • 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

    Constructors
    Constructor
    Description
    SimResourceInstance(de.uka.ipd.sdq.scheduler.SchedulerModel model, int number, de.uka.ipd.sdq.scheduler.IActiveResource containing_resource)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addObserver(de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor observer)
     
    void
    assign(de.uka.ipd.sdq.scheduler.IRunningProcess process)
    Assigns a new process to this instance.
    void
    Removes a pending SchedulingEvent.
    boolean
     
    int
     
    de.uka.ipd.sdq.scheduler.IRunningProcess
     
    Unique name of the resource instance.
    double
     
    int
     
    de.uka.ipd.sdq.scheduler.IRunningProcess
     
    int
     
    boolean
     
    boolean
     
    boolean
     
    void
    Releases the current resource instance.
    void
    removeObserver(de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor observer)
     
    void
    Schedules the next SchedulingEvent for the instance at the specified time.
    void
    schedulingInterrupt(double time)
    Schedules a SchedulingInterrupt.
    void
    setIsScheduling(boolean b)
     
    void
     
    void
     
     

    Methods inherited from class de.uka.ipd.sdq.scheduler.entities.SchedulerEntity

    getModel

    Methods inherited from class de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator

    getEncapsulatedEntity, isScheduled, reschedule

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface de.uka.ipd.sdq.simulation.abstractsimengine.IEntity

    isScheduled, reschedule
  • Constructor Details

    • SimResourceInstance

      public SimResourceInstance(de.uka.ipd.sdq.scheduler.SchedulerModel model, int number, de.uka.ipd.sdq.scheduler.IActiveResource containing_resource)
  • Method Details

    • getRunningProcess

      public de.uka.ipd.sdq.scheduler.IRunningProcess getRunningProcess()
      Specified by:
      getRunningProcess in interface IResourceInstance
      Returns:
      Returns the process currently executing on the resource.
    • release

      public void release()
      Description copied from interface: IResourceInstance
      Releases the current resource instance.
      Specified by:
      release in interface IResourceInstance
    • addObserver

      public void addObserver(de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor observer)
      Specified by:
      addObserver in interface IResourceInstance
    • removeObserver

      public void removeObserver(de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor observer)
      Specified by:
      removeObserver in interface IResourceInstance
    • processAssigned

      public boolean processAssigned()
      Specified by:
      processAssigned in interface IResourceInstance
      Returns:
      True, if there is process executing on this resource instance, false otherwise.
    • assign

      public void assign(de.uka.ipd.sdq.scheduler.IRunningProcess process)
      Description copied from interface: IResourceInstance
      Assigns a new process to this instance. Note that the resource has to be idle to do so.
      Specified by:
      assign in interface IResourceInstance
      Parameters:
      process - Process to execute on the resource instance.
    • getName

      public String getName()
      Description copied from interface: IResourceInstance
      Unique name of the resource instance.
      Specified by:
      getName in interface IResourceInstance
      Overrides:
      getName in class de.uka.ipd.sdq.simulation.abstractsimengine.SimulationElement
      Returns:
      The unique name of the resource instance.
    • scheduleSchedulingEvent

      public void scheduleSchedulingEvent(double time)
      Description copied from interface: IResourceInstance
      Schedules the next SchedulingEvent for the instance at the specified time. The event my be deferred or canceled by other actions.
      Specified by:
      scheduleSchedulingEvent in interface IResourceInstance
      Parameters:
      time - Time the event shall occur.
    • schedulingInterrupt

      public void schedulingInterrupt(double time)
      Description copied from interface: IResourceInstance
      Schedules a SchedulingInterrupt. This event cannot be interrupted or moved and will occur at the specified time.
      Specified by:
      schedulingInterrupt in interface IResourceInstance
    • cancelSchedulingEvent

      public void cancelSchedulingEvent()
      Description copied from interface: IResourceInstance
      Removes a pending SchedulingEvent.
      Specified by:
      cancelSchedulingEvent in interface IResourceInstance
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getId

      public int getId()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getNextSchedEventTime

      public double getNextSchedEventTime()
      Specified by:
      getNextSchedEventTime in interface IResourceInstance
    • start

      public void start()
      Specified by:
      start in interface IResourceInstance
    • stop

      public void stop()
      Specified by:
      stop in interface IResourceInstance
    • setIsScheduling

      public void setIsScheduling(boolean b)
      Specified by:
      setIsScheduling in interface IResourceInstance
    • isScheduling

      public boolean isScheduling()
      Specified by:
      isScheduling in interface IResourceInstance
    • isIdle

      public boolean isIdle()
      Specified by:
      isIdle in interface IResourceInstance
    • getLastRunningProcess

      public de.uka.ipd.sdq.scheduler.IRunningProcess getLastRunningProcess()
      Specified by:
      getLastRunningProcess in interface IResourceInstance
    • getQueueLength

      public int getQueueLength()