Class AbstractScheduler
- java.lang.Object
-
- edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.strategy.impl.AbstractScheduler
-
- All Implemented Interfaces:
IScheduler
- Direct Known Subclasses:
PreemptiveScheduler
public abstract class AbstractScheduler extends Object implements IScheduler
-
-
Field Summary
Fields Modifier and Type Field Description protected IQueueingStrategy
queueing_strategy
protected SimActiveResource
resource
protected double
scheduling_interval
protected StarvationBoost
starvationBoost
-
Constructor Summary
Constructors Constructor Description AbstractScheduler(SimActiveResource resource, IQueueingStrategy queueingStrategy, boolean in_front_after_waiting, StarvationBoost starvationBoost)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forkNewProcess(IActiveProcess process, IResourceInstance current)
Registers a new process and adds it to the scheduler's runqueue(s).protected void
fromReadyToRunningOn(IActiveProcess process, IResourceInstance instance)
Marks the given process as executing on the specified resource instance.protected void
fromRunningToReady(IActiveProcess process, IResourceInstance current, boolean inFront)
void
fromRunningToWaiting(WaitingProcess waiting_process, Deque<de.uka.ipd.sdq.scheduler.processes.IWaitingProcess> waiting_queue, boolean in_front)
Notifies the scheduler, that a running process has to change its state to waiting.void
fromWaitingToReady(WaitingProcess waiting_process, Deque<de.uka.ipd.sdq.scheduler.processes.IWaitingProcess> waitingQueue, IResourceInstance current)
Notifies the scheduler, that a process finished its waiting period and becomes ready for execution.void
registerProcess(IActiveProcess p, IResourceInstance instance)
void
terminateProcess(IActiveProcess process, IResourceInstance current)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.strategy.IScheduler
getInterval, getQueueLengthFor, isIdle, schedule, scheduleNextEvent
-
-
-
-
Field Detail
-
resource
protected SimActiveResource resource
-
queueing_strategy
protected IQueueingStrategy queueing_strategy
-
scheduling_interval
protected double scheduling_interval
-
starvationBoost
protected StarvationBoost starvationBoost
-
-
Constructor Detail
-
AbstractScheduler
public AbstractScheduler(SimActiveResource resource, IQueueingStrategy queueingStrategy, boolean in_front_after_waiting, StarvationBoost starvationBoost)
-
-
Method Detail
-
forkNewProcess
public void forkNewProcess(IActiveProcess process, IResourceInstance current)
Description copied from interface:IScheduler
Registers a new process and adds it to the scheduler's runqueue(s).- Specified by:
forkNewProcess
in interfaceIScheduler
-
registerProcess
public void registerProcess(IActiveProcess p, IResourceInstance instance)
- Specified by:
registerProcess
in interfaceIScheduler
-
terminateProcess
public void terminateProcess(IActiveProcess process, IResourceInstance current)
- Specified by:
terminateProcess
in interfaceIScheduler
-
fromReadyToRunningOn
protected void fromReadyToRunningOn(IActiveProcess process, IResourceInstance instance)
Marks the given process as executing on the specified resource instance.- Parameters:
process
-instance
-
-
fromRunningToReady
protected void fromRunningToReady(IActiveProcess process, IResourceInstance current, boolean inFront)
- Parameters:
process
-
-
fromRunningToWaiting
public void fromRunningToWaiting(WaitingProcess waiting_process, Deque<de.uka.ipd.sdq.scheduler.processes.IWaitingProcess> waiting_queue, boolean in_front)
Description copied from interface:IScheduler
Notifies the scheduler, that a running process has to change its state to waiting. Takes care of the complete state change, including the insertion of the process into the waiting queue.- Specified by:
fromRunningToWaiting
in interfaceIScheduler
- Parameters:
waiting_process
- Wrapper for the waiting process. Includes additional information about the waiting state.waiting_queue
- The queue where the process has to wait.in_front
- If true, the process is inserted at the front of the queue, otherwise it is inserted at the end.
-
fromWaitingToReady
public void fromWaitingToReady(WaitingProcess waiting_process, Deque<de.uka.ipd.sdq.scheduler.processes.IWaitingProcess> waitingQueue, IResourceInstance current)
Description copied from interface:IScheduler
Notifies the scheduler, that a process finished its waiting period and becomes ready for execution. It takes care of the complete state change including the removal of the process from its waiting queue.- Specified by:
fromWaitingToReady
in interfaceIScheduler
- Parameters:
waiting_process
- Wrapper for the waiting process.waitingQueue
- Queue where the process is waiting.
-
-