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
delegate
Fields inherited from interface de.uka.ipd.sdq.simulation.abstractsimengine.IEntity
NULL
-
Constructor Summary
ConstructorDescriptionSimResourceInstance
(de.uka.ipd.sdq.scheduler.SchedulerModel model, int number, de.uka.ipd.sdq.scheduler.IActiveResource containing_resource) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
getId()
de.uka.ipd.sdq.scheduler.IRunningProcess
getName()
Unique name of the resource instance.double
int
de.uka.ipd.sdq.scheduler.IRunningProcess
int
hashCode()
boolean
isIdle()
boolean
boolean
void
release()
Releases the current resource instance.void
removeObserver
(de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor observer) void
scheduleSchedulingEvent
(double time) Schedules the next SchedulingEvent for the instance at the specified time.void
schedulingInterrupt
(double time) Schedules a SchedulingInterrupt.void
setIsScheduling
(boolean b) void
start()
void
stop()
toString()
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 interfaceIResourceInstance
- 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 interfaceIResourceInstance
-
addObserver
public void addObserver(de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor observer) - Specified by:
addObserver
in interfaceIResourceInstance
-
removeObserver
public void removeObserver(de.uka.ipd.sdq.scheduler.sensors.IActiveResourceStateSensor observer) - Specified by:
removeObserver
in interfaceIResourceInstance
-
processAssigned
public boolean processAssigned()- Specified by:
processAssigned
in 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:IResourceInstance
Assigns a new process to this instance. Note that the resource has to be idle to do so.- Specified by:
assign
in interfaceIResourceInstance
- Parameters:
process
- Process to execute on the resource instance.
-
getName
Description copied from interface:IResourceInstance
Unique name of the resource instance.- Specified by:
getName
in interfaceIResourceInstance
- Overrides:
getName
in 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: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 interfaceIResourceInstance
- 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 interfaceIResourceInstance
-
cancelSchedulingEvent
public void cancelSchedulingEvent()Description copied from interface:IResourceInstance
Removes a pending SchedulingEvent.- Specified by:
cancelSchedulingEvent
in interfaceIResourceInstance
-
toString
-
equals
-
getId
public int getId() -
hashCode
public int hashCode() -
getNextSchedEventTime
public double getNextSchedEventTime()- Specified by:
getNextSchedEventTime
in interfaceIResourceInstance
-
start
public void start()- Specified by:
start
in interfaceIResourceInstance
-
stop
public void stop()- Specified by:
stop
in interfaceIResourceInstance
-
setIsScheduling
public void setIsScheduling(boolean b) - Specified by:
setIsScheduling
in interfaceIResourceInstance
-
isScheduling
public boolean isScheduling()- Specified by:
isScheduling
in interfaceIResourceInstance
-
isIdle
public boolean isIdle()- Specified by:
isIdle
in interfaceIResourceInstance
-
getLastRunningProcess
public de.uka.ipd.sdq.scheduler.IRunningProcess getLastRunningProcess()- Specified by:
getLastRunningProcess
in interfaceIResourceInstance
-
getQueueLength
public int getQueueLength()
-