de.uka.ipd.sdq.scheduler.resources
Interface IResourceInstance

All Known Implementing Classes:
SimResourceInstance

public interface IResourceInstance

This class represents an instance of an active resources. It got a unique ID and knows the process it is currently executing.

Author:
jens

Method Summary
 void addObserver(IActiveResourceStateSensor observer)
           
 void assign(IRunningProcess process)
          Assigns a new process to this instance.
 void cancelSchedulingEvent()
          Removes a pending SchedulingEvent.
 IRunningProcess getLastRunningProcess()
           
 String getName()
          Unique name of the resource instance.
 double getNextSchedEventTime()
           
 IRunningProcess getRunningProcess()
           
 boolean isIdle()
           
 boolean isScheduling()
           
 boolean processAssigned()
           
 void release()
          Releases the current resource instance.
 void removeObserver(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()
           
 

Method Detail

getName

String getName()
Unique name of the resource instance.

Returns:
The unique name of the resource instance.

getRunningProcess

IRunningProcess getRunningProcess()
Returns:
Returns the process currently executing on the resource.

processAssigned

boolean processAssigned()
Returns:
True, if there is process executing on this resource instance, false otherwise.

assign

void assign(IRunningProcess process)
Assigns a new process to this instance. Note that the resource has to be idle to do so.

Parameters:
process - Process to execute on the resource instance.

release

void release()
Releases the current resource instance.


scheduleSchedulingEvent

void scheduleSchedulingEvent(double time)
Schedules the next SchedulingEvent for the instance at the specified time. The event my be deferred or canceled by other actions.

Parameters:
time - Time the event shall occur.

schedulingInterrupt

void schedulingInterrupt(double time)
Schedules a SchedulingInterrupt. This event cannot be interrupted or moved and will occur at the specified time.

Parameters:
time -
b -

cancelSchedulingEvent

void cancelSchedulingEvent()
Removes a pending SchedulingEvent.


getNextSchedEventTime

double getNextSchedEventTime()

start

void start()

stop

void stop()

setIsScheduling

void setIsScheduling(boolean b)

isScheduling

boolean isScheduling()

addObserver

void addObserver(IActiveResourceStateSensor observer)

removeObserver

void removeObserver(IActiveResourceStateSensor observer)

isIdle

boolean isIdle()

getLastRunningProcess

IRunningProcess getLastRunningProcess()