Class PriorityArray
java.lang.Object
edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.queueing.basicqueues.PriorityArray
- All Implemented Interfaces:
IProcessQueue
-
Constructor Summary
ConstructorsConstructorDescriptionPriorityArray(de.uka.ipd.sdq.scheduler.SchedulerModel model, IPriorityManager priority_manager) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(IActiveProcess process, boolean in_front) voidaddFirst(IActiveProcess process) Adds a new process at the BEGINNING of the process' priority's queue.voidaddLast(IActiveProcess process) Adds a new process at the END of the process' priority's queue.booleancontains(IActiveProcess process) getBestRunnableQueue(IResourceInstance instance) Returns the queue with the highest priority of which at least one process can be executed on instance.getNextRunnableProcess(IResourceInstance instance) Returns the process with the highest priority runnable on the given instance.getStarvingProcesses(double starvationLimit) doublegetWaitingTime(IActiveProcess process) voididentifyMovableProcesses(IResourceInstance target_instance, boolean prio_increasing, boolean queue_ascending, int processes_needed, List<IActiveProcess> process_list) Adds processes that do not violate the affinity constraint to the list in the specified direction.booleanisEmpty()booleanprocessStarving(double threshold) booleanremove(IActiveProcess process) Removes the given process from the priorityarray.voidsetWaitingTime(IActiveProcess process, double waiting) intsize()Returns the number of processes in the priority array.
-
Constructor Details
-
PriorityArray
public PriorityArray(de.uka.ipd.sdq.scheduler.SchedulerModel model, IPriorityManager priority_manager)
-
-
Method Details
-
size
public int size()Returns the number of processes in the priority array.- Specified by:
sizein interfaceIProcessQueue
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIProcessQueue- Returns:
- True, if the priority array is empty. False, otherwise.
-
remove
Removes the given process from the priorityarray.- Specified by:
removein interfaceIProcessQueue- Parameters:
process-- Returns:
- True, if the process has been successfully removed. False, otherwise.
-
addLast
Adds a new process at the END of the process' priority's queue.- Specified by:
addLastin interfaceIProcessQueue- Parameters:
process-
-
addFirst
Adds a new process at the BEGINNING of the process' priority's queue.- Specified by:
addFirstin interfaceIProcessQueue- Parameters:
process-
-
add
- Specified by:
addin interfaceIProcessQueue
-
getBestRunnableQueue
Returns the queue with the highest priority of which at least one process can be executed on instance.- Specified by:
getBestRunnableQueuein interfaceIProcessQueue- Parameters:
instance-- Returns:
-
getNextRunnableProcess
Returns the process with the highest priority runnable on the given instance.- Specified by:
getNextRunnableProcessin interfaceIProcessQueue- Parameters:
instance-- Returns:
-
contains
- Specified by:
containsin interfaceIProcessQueue
-
getNextRunnableProcess
- Specified by:
getNextRunnableProcessin interfaceIProcessQueue
-
identifyMovableProcesses
public void identifyMovableProcesses(IResourceInstance target_instance, boolean prio_increasing, boolean queue_ascending, int processes_needed, List<IActiveProcess> process_list) Adds processes that do not violate the affinity constraint to the list in the specified direction.- Specified by:
identifyMovableProcessesin interfaceIProcessQueue- Parameters:
target_instance-
-
ascending
- Specified by:
ascendingin interfaceIProcessQueue
-
descending
- Specified by:
descendingin interfaceIProcessQueue
-
createNewInstance
- Specified by:
createNewInstancein interfaceIProcessQueue
-
processStarving
public boolean processStarving(double threshold) - Specified by:
processStarvingin interfaceIProcessQueue
-
getWaitingTime
- Specified by:
getWaitingTimein interfaceIProcessQueue
-
setWaitingTime
- Specified by:
setWaitingTimein interfaceIProcessQueue
-
getStarvingProcesses
- Specified by:
getStarvingProcessesin interfaceIProcessQueue
-