ProterScheduler
The default priority based Scheduler.
Relies on the use of Schedules for each TaskResource.
Avoids scheduling lower priority tasks that might cause delays/waiting times to higher priority ones.
- Value Params
- initialTasks
Initial TaskInstances in the queue, if any.
Value members
Concrete methods
Finds the Tasks that can be started now.
Finds the Tasks that can be started now.
Tasks are assumed to be sorted by priority.
Taking each TaskInstance from high to low priority, the algorithm does the following:
- It merges the current Schedules of all the TaskResources involved in the TaskInstance.
- It finds the earliest possible starting time of the TaskInstance in the merged Schedule.
- Takes the interval defined by the starting time and the estimated duration of the TaskInstance and adds it to the Schedules of all the involved TaskResources.
- If the starting time is equal to the current time, and all involved TaskResources are idle, it adds the TaskInstance to the result.
- Value Params
- currentTime
The current timestamp.
- resourceMap
The map of available TaskResources.
- result
The accumulated TaskInstances so far (for tail recursion).
- schedules
The map of Schedules for each TaskResource.
- tasks
The set of TaskInstances that need to start.
- Returns
The sequence of TaskInstances to start now.
Determines which TaskInstances to start next.
Determines which TaskInstances to start next.
TaskInstances are assumed to be sorted by priority.
Uses findNextTasks.
- Value Params
- currentTime
The current timestamp.
- resourceMap
The map of available TaskResources.
- tasks
The queue of TaskInstances waiting to be started.
- Returns
The sequence of TaskInstances to start now.
- See also
- Definition Classes
Inherited methods
Adds a TaskInstance to be scheduled.
Adds a TaskInstance to be scheduled.
- Definition Classes
- Inherited from
- PriorityScheduler
Adds an Task described by an (ID,time) pair to the list of completed IDs
Adds an Task described by an (ID,time) pair to the list of completed IDs
- Value Params
- id
The ID to be added
- time
The time at which the task completed
- Returns
A LookaheadStructure with this (ID,time) pair added to the list of completed tasks
- Inherited from
- Scheduler
Retrieves an iterable collection of queued TaskInstances.
Retrieves an iterable collection of queued TaskInstances.
- Definition Classes
- Inherited from
- PriorityScheduler
Checks if a named TaskResource is idle.
Checks if a named TaskResource is idle.
- Value Params
- r
The name of the TaskResource.
- resourceMap
The map of available TaskResources.
- Returns
true if the resource is idle, false otherwise.
- Inherited from
- Scheduler
Checks if all Tasks have been scheduled.
Checks if all Tasks have been scheduled.
- Definition Classes
- Inherited from
- PriorityScheduler
Removes the lookahead structure associated with the given actor.
Removes the lookahead structure associated with the given actor.
- Value Params
- actor
The actor corresponding to the lookahead structure.
- Inherited from
- Scheduler
Removes all TaskInstances belonging to an (presumably aborted) simulation.
Removes all TaskInstances belonging to an (presumably aborted) simulation.
- Definition Classes
- Inherited from
- PriorityScheduler
Removes a TaskInstance that no longer needs scheduling.
Removes a TaskInstance that no longer needs scheduling.
- Definition Classes
- Inherited from
- PriorityScheduler
Sets the lookahead structure for the specified actor.
Sets the lookahead structure for the specified actor.
- Value Params
- actor
The actor that created this lookahead structure.
- obj
The lookahead structure.
- Inherited from
- Scheduler
Inherited fields
A sorted queue of tasks that need to be run.
A sorted queue of tasks that need to be run.
- Inherited from
- PriorityScheduler