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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addProcess
(IActiveProcess process, boolean inFront) Adds a process to the runqueue.protected abstract void
addProcessToRunQueue
(IActiveProcess process, boolean inFront) Template method.boolean
contains
(IActiveProcess process) abstract boolean
containsPending
(IActiveProcess process) Template Method.boolean
containsRunning
(IActiveProcess process) Checks if the runqueue contains a running process.int
Returns the current number of processes in the ready queues.abstract IActiveProcess
getNextRunnableProcess
(IResourceInstance instance) Returns the next process runnable on the given instance.boolean
isEmpty()
boolean
isIdle
(IResourceInstance instance) True, if there is no process running on the given resource.protected abstract int
Template Method.abstract boolean
removePendingProcess
(IActiveProcess process) Template method.boolean
removeProcess
(IActiveProcess process) Removes a process from the runqueue.void
removeRunning
(IActiveProcess process) Removes a running process from the runqueue.runningOn
(IActiveProcess process) void
setRunningOn
(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, wait
Methods 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:IRunQueue
Returns the current number of processes in the ready queues.- Specified by:
getCurrentLoad
in interfaceIRunQueue
-
isEmpty
public boolean isEmpty() -
removeProcess
Description copied from interface:IRunQueue
Removes a process from the runqueue.- Specified by:
removeProcess
in interfaceIRunQueue
- Returns:
- True, if the process was removed. False, if the process was not found in the queue.
-
contains
-
addProcess
Description copied from interface:IRunQueue
Adds a process to the runqueue.- Specified by:
addProcess
in interfaceIRunQueue
inFront
- 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:IRunQueue
Checks if the runqueue contains a running process.- Specified by:
containsRunning
in 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:IRunQueue
Removes a running process from the runqueue.- Specified by:
removeRunning
in interfaceIRunQueue
- Parameters:
process
- Process of interest.
-
setRunningOn
Description copied from interface:IRunQueue
Sets the given process as running on the specified instance. Note that the process must not be marked as running on another instance.- Specified by:
setRunningOn
in interfaceIRunQueue
- Parameters:
process
- Process to run.instance
- Instance the process shall run on.
-
runningOn
-
isIdle
Description copied from interface:IRunQueue
True, 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:IRunQueue
Returns the next process runnable on the given instance.- Specified by:
getNextRunnableProcess
in interfaceIRunQueue
-
containsPending
Template Method. Returns- Specified by:
containsPending
in 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:
removePendingProcess
in 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
-
-