Class AbstractScheduler
java.lang.Object
edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.strategy.impl.AbstractScheduler
- All Implemented Interfaces:
IScheduler
- Direct Known Subclasses:
PreemptiveScheduler
-
Field Summary
Modifier and TypeFieldDescriptionprotected IQueueingStrategy
protected SimActiveResource
protected double
protected StarvationBoost
-
Constructor Summary
ConstructorDescriptionAbstractScheduler
(SimActiveResource resource, IQueueingStrategy queueingStrategy, boolean in_front_after_waiting, StarvationBoost starvationBoost) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 Details
-
resource
-
queueing_strategy
-
scheduling_interval
protected double scheduling_interval -
starvationBoost
-
-
Constructor Details
-
AbstractScheduler
public AbstractScheduler(SimActiveResource resource, IQueueingStrategy queueingStrategy, boolean in_front_after_waiting, StarvationBoost starvationBoost)
-
-
Method Details
-
forkNewProcess
Description copied from interface:IScheduler
Registers a new process and adds it to the scheduler's runqueue(s).- Specified by:
forkNewProcess
in interfaceIScheduler
-
registerProcess
- Specified by:
registerProcess
in interfaceIScheduler
-
terminateProcess
- Specified by:
terminateProcess
in interfaceIScheduler
-
fromReadyToRunningOn
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.
-