Class SimResourceInstance
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
delegateFields inherited from interface de.uka.ipd.sdq.simulation.abstractsimengine.IEntity
NULL -
Constructor Summary
ConstructorsConstructorDescriptionSimResourceInstance(de.uka.ipd.sdq.scheduler.SchedulerModel model, int number, de.uka.ipd.sdq.scheduler.IActiveResource containing_resource) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor observer) voidassign(de.uka.ipd.sdq.scheduler.IRunningProcess process) Assigns a new process to this instance.voidRemoves a pending SchedulingEvent.booleanintgetId()de.uka.ipd.sdq.scheduler.IRunningProcessgetName()Unique name of the resource instance.doubleintde.uka.ipd.sdq.scheduler.IRunningProcessinthashCode()booleanisIdle()booleanbooleanvoidrelease()Releases the current resource instance.voidremoveObserver(de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor observer) voidscheduleSchedulingEvent(double time) Schedules the next SchedulingEvent for the instance at the specified time.voidschedulingInterrupt(double time) Schedules a SchedulingInterrupt.voidsetIsScheduling(boolean b) voidstart()voidstop()toString()Methods inherited from class de.uka.ipd.sdq.scheduler.entities.SchedulerEntity
getModelMethods inherited from class de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator
getEncapsulatedEntity, isScheduled, rescheduleMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
getRunningProcessin interfaceIResourceInstance- Returns:
- Returns the process currently executing on the resource.
-
release
public void release()Description copied from interface:IResourceInstanceReleases the current resource instance.- Specified by:
releasein interfaceIResourceInstance
-
addObserver
public void addObserver(de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor observer) - Specified by:
addObserverin interfaceIResourceInstance
-
removeObserver
public void removeObserver(de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor observer) - Specified by:
removeObserverin interfaceIResourceInstance
-
processAssigned
public boolean processAssigned()- Specified by:
processAssignedin interfaceIResourceInstance- 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:IResourceInstanceAssigns a new process to this instance. Note that the resource has to be idle to do so.- Specified by:
assignin interfaceIResourceInstance- Parameters:
process- Process to execute on the resource instance.
-
getName
Description copied from interface:IResourceInstanceUnique name of the resource instance.- Specified by:
getNamein interfaceIResourceInstance- Overrides:
getNamein classde.uka.ipd.sdq.simulation.abstractsimengine.SimulationElement- Returns:
- The unique name of the resource instance.
-
scheduleSchedulingEvent
public void scheduleSchedulingEvent(double time) Description copied from interface:IResourceInstanceSchedules the next SchedulingEvent for the instance at the specified time. The event my be deferred or canceled by other actions.- Specified by:
scheduleSchedulingEventin interfaceIResourceInstance- Parameters:
time- Time the event shall occur.
-
schedulingInterrupt
public void schedulingInterrupt(double time) Description copied from interface:IResourceInstanceSchedules a SchedulingInterrupt. This event cannot be interrupted or moved and will occur at the specified time.- Specified by:
schedulingInterruptin interfaceIResourceInstance
-
cancelSchedulingEvent
public void cancelSchedulingEvent()Description copied from interface:IResourceInstanceRemoves a pending SchedulingEvent.- Specified by:
cancelSchedulingEventin interfaceIResourceInstance
-
toString
-
equals
-
getId
public int getId() -
hashCode
public int hashCode() -
getNextSchedEventTime
public double getNextSchedEventTime()- Specified by:
getNextSchedEventTimein interfaceIResourceInstance
-
start
public void start()- Specified by:
startin interfaceIResourceInstance
-
stop
public void stop()- Specified by:
stopin interfaceIResourceInstance
-
setIsScheduling
public void setIsScheduling(boolean b) - Specified by:
setIsSchedulingin interfaceIResourceInstance
-
isScheduling
public boolean isScheduling()- Specified by:
isSchedulingin interfaceIResourceInstance
-
isIdle
public boolean isIdle()- Specified by:
isIdlein interfaceIResourceInstance
-
getLastRunningProcess
public de.uka.ipd.sdq.scheduler.IRunningProcess getLastRunningProcess()- Specified by:
getLastRunningProcessin interfaceIResourceInstance
-
getQueueLength
public int getQueueLength()
-