Class 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)  
    • Constructor Detail

      • SimResourceInstance

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

      • getRunningProcess

        public de.uka.ipd.sdq.scheduler.IRunningProcess getRunningProcess()
        Specified by:
        getRunningProcess in interface IResourceInstance
        Returns:
        Returns the process currently executing on the resource.
      • 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
      • getId

        public int getId()
      • hashCode

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

        public int getQueueLength()