Class AbstractRunQueue
java.lang.Object
edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.queueing.runqueues.AbstractRunQueue
- All Implemented Interfaces:
IRunQueue
- Direct Known Subclasses:
ActiveExpiredRunQueue,SingleRunQueue
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProcess(IActiveProcess process, boolean inFront) Adds a process to the runqueue.protected abstract voidaddProcessToRunQueue(IActiveProcess process, boolean inFront) Template method.booleancontains(IActiveProcess process) abstract booleancontainsPending(IActiveProcess process) Template Method.booleancontainsRunning(IActiveProcess process) Checks if the runqueue contains a running process.intReturns the current number of processes in the ready queues.abstract IActiveProcessgetNextRunnableProcess(IResourceInstance instance) Returns the next process runnable on the given instance.booleanisEmpty()booleanisIdle(IResourceInstance instance) True, if there is no process running on the given resource.protected abstract intTemplate Method.abstract booleanremovePendingProcess(IActiveProcess process) Template method.booleanremoveProcess(IActiveProcess process) Removes a process from the runqueue.voidremoveRunning(IActiveProcess process) Removes a running process from the runqueue.runningOn(IActiveProcess process) voidsetRunningOn(IActiveProcess process, IResourceInstance instance) Sets the given process as running on the specified instance.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.queueing.IRunQueue
createNewInstance, getBestRunnableQueue, getNextRunnableProcess, getStarvingProcesses, getWaitingTime, identifyMovableProcesses, processStarving, resetStarvationInfo, setWaitingTime
-
Field Details
-
running_on_table
-
-
Constructor Details
-
AbstractRunQueue
protected AbstractRunQueue()
-
-
Method Details
-
getCurrentLoad
public int getCurrentLoad()Description copied from interface:IRunQueueReturns the current number of processes in the ready queues.- Specified by:
getCurrentLoadin interfaceIRunQueue
-
isEmpty
public boolean isEmpty() -
removeProcess
Description copied from interface:IRunQueueRemoves a process from the runqueue.- Specified by:
removeProcessin interfaceIRunQueue- Returns:
- True, if the process was removed. False, if the process was not found in the queue.
-
contains
-
addProcess
Description copied from interface:IRunQueueAdds a process to the runqueue.- Specified by:
addProcessin interfaceIRunQueueinFront- If true, the process is added at the beginning of its queue, otherwise it is added at the queue's end.
-
containsRunning
Description copied from interface:IRunQueueChecks if the runqueue contains a running process.- Specified by:
containsRunningin interfaceIRunQueue- Parameters:
process- Process of interest.- Returns:
- True, if the process is in the running list of the runqueue, otherwise false.
-
removeRunning
Description copied from interface:IRunQueueRemoves a running process from the runqueue.- Specified by:
removeRunningin interfaceIRunQueue- Parameters:
process- Process of interest.
-
setRunningOn
Description copied from interface:IRunQueueSets the given process as running on the specified instance. Note that the process must not be marked as running on another instance.- Specified by:
setRunningOnin interfaceIRunQueue- Parameters:
process- Process to run.instance- Instance the process shall run on.
-
runningOn
-
isIdle
Description copied from interface:IRunQueueTrue, if there is no process running on the given resource. Furthermore, the pending queue has to be empty if there is only one instance. -
getNextRunnableProcess
Description copied from interface:IRunQueueReturns the next process runnable on the given instance.- Specified by:
getNextRunnableProcessin interfaceIRunQueue
-
containsPending
Template Method. Returns- Specified by:
containsPendingin interfaceIRunQueue- Parameters:
process-- Returns:
-
numWaitingProcesses
protected abstract int numWaitingProcesses()Template Method. Returns the number of processs waiting in the queue.- Returns:
-
removePendingProcess
Template method. Removes the given process from the queue.- Specified by:
removePendingProcessin interfaceIRunQueue- Parameters:
process-- Returns:
- True, if the process was successfully removed, otherwise (if the process was not found) false.
-
addProcessToRunQueue
Template method.- Parameters:
process-inFront-
-