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
FieldsModifier and TypeFieldDescriptionprotected IQueueingStrategyprotected SimActiveResourceprotected doubleprotected StarvationBoost -
Constructor Summary
ConstructorsConstructorDescriptionAbstractScheduler(SimActiveResource resource, IQueueingStrategy queueingStrategy, boolean in_front_after_waiting, StarvationBoost starvationBoost) -
Method Summary
Modifier and TypeMethodDescriptionvoidforkNewProcess(IActiveProcess process, IResourceInstance current) Registers a new process and adds it to the scheduler's runqueue(s).protected voidfromReadyToRunningOn(IActiveProcess process, IResourceInstance instance) Marks the given process as executing on the specified resource instance.protected voidfromRunningToReady(IActiveProcess process, IResourceInstance current, boolean inFront) voidfromRunningToWaiting(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.voidfromWaitingToReady(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.voidregisterProcess(IActiveProcess p, IResourceInstance instance) voidterminateProcess(IActiveProcess process, IResourceInstance current) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ISchedulerRegisters a new process and adds it to the scheduler's runqueue(s).- Specified by:
forkNewProcessin interfaceIScheduler
-
registerProcess
- Specified by:
registerProcessin interfaceIScheduler
-
terminateProcess
- Specified by:
terminateProcessin 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:ISchedulerNotifies 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:
fromRunningToWaitingin 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:ISchedulerNotifies 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:
fromWaitingToReadyin interfaceIScheduler- Parameters:
waiting_process- Wrapper for the waiting process.waitingQueue- Queue where the process is waiting.
-