Class ActiveExpiredRunQueue
java.lang.Object
edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.queueing.runqueues.AbstractRunQueue
edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.queueing.runqueues.ActiveExpiredRunQueue
- All Implemented Interfaces:
IRunQueue
-
Field Summary
Fields inherited from class edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.queueing.runqueues.AbstractRunQueue
running_on_table -
Constructor Summary
ConstructorsConstructorDescriptionActiveExpiredRunQueue(de.uka.ipd.sdq.scheduler.SchedulerModel model, IProcessQueue queue_prototype) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanDetermines whether the current active queue is empty including the running and standby processes.voidaddProcessToRunQueue(IActiveProcess process, boolean inFront) Adds a new process to the end of the expired priority array.booleancontainsPending(IActiveProcess process) Template Method.Prototype Object Pattern.getBestRunnableQueue(IResourceInstance instance) Returns the next runnable process.getNextRunnableProcess(IResourceInstance instance) Returns the next process runnable on the given instance.getStarvingProcesses(double starvationLimit) doublegetWaitingTime(IActiveProcess process) identifyMovableProcesses(IResourceInstance targetInstance, boolean prio_increasing, boolean queue_ascending, int processes_needed) Composes a list of processes movable to the specified target.protected intTemplate Method.booleanprocessStarving(double threshold) booleanremovePendingProcess(IActiveProcess process) Template method.voidvoidsetWaitingTime(IActiveProcess process, double waiting) Methods inherited from class edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.queueing.runqueues.AbstractRunQueue
addProcess, contains, containsRunning, getCurrentLoad, isEmpty, isIdle, removeProcess, removeRunning, runningOn, setRunningOn
-
Constructor Details
-
ActiveExpiredRunQueue
public ActiveExpiredRunQueue(de.uka.ipd.sdq.scheduler.SchedulerModel model, IProcessQueue queue_prototype)
-
-
Method Details
-
addProcessToRunQueue
Adds a new process to the end of the expired priority array.- Specified by:
addProcessToRunQueuein classAbstractRunQueue
-
numWaitingProcesses
protected int numWaitingProcesses()Description copied from class:AbstractRunQueueTemplate Method. Returns the number of processs waiting in the queue.- Specified by:
numWaitingProcessesin classAbstractRunQueue- Returns:
-
getNextRunnableProcess
Description copied from interface:IRunQueueReturns the next process runnable on the given instance.- Specified by:
getNextRunnableProcessin interfaceIRunQueue- Specified by:
getNextRunnableProcessin classAbstractRunQueue
-
getNextRunnableProcess
Description copied from interface:IRunQueueReturns the next runnable process.- Returns:
-
removePendingProcess
Description copied from class:AbstractRunQueueTemplate method. Removes the given process from the queue.- Specified by:
removePendingProcessin interfaceIRunQueue- Specified by:
removePendingProcessin classAbstractRunQueue- Parameters:
process- Process of interest.- Returns:
- True, if the process was successfully removed, otherwise (if the process was not found) false.
-
activeQueueEmpty
protected boolean activeQueueEmpty()Determines whether the current active queue is empty including the running and standby processes. -
createNewInstance
Description copied from interface:IRunQueuePrototype Object Pattern. Creates a new instance of the given runqueue.- Returns:
-
identifyMovableProcesses
public List<IActiveProcess> identifyMovableProcesses(IResourceInstance targetInstance, boolean prio_increasing, boolean queue_ascending, int processes_needed) Description copied from interface:IRunQueueComposes a list of processes movable to the specified target. The list is ordered in terms of what suits best for the target resource instance. The first element is better than the second which is better than the third and so on. Note that currently running processes are never added to the movable list.- Parameters:
targetInstance- Resource instance the processes shall be moved to.prio_increasing- If true, the processes in the resulting list are ordered with an increasing priority, otherwise with a decreasing priority.queue_ascending- If true, processes in the resulting list are in the same order as in the queue, otherwise they are in reverse order.processes_needed- The maximum number of processes needed for the resource.- Returns:
- An ordered list of processes movable to the target resource.
-
getBestRunnableQueue
- Parameters:
instance- Resource instance a process is needed for.- Returns:
- Returns the most urgent queue which contains at least one process which can run on the given instance. NULL if no such queue exists.
-
containsPending
Description copied from class:AbstractRunQueueTemplate Method. Returns- Specified by:
containsPendingin interfaceIRunQueue- Specified by:
containsPendingin classAbstractRunQueue- Parameters:
process- Process of interest.- Returns:
- True, if the process is pending in the runqueue.
-
processStarving
public boolean processStarving(double threshold) -
getStarvingProcesses
-
setWaitingTime
-
getWaitingTime
-
resetStarvationInfo
public void resetStarvationInfo()
-