Model . Node - SeanSpires/Project1-306-Team-Stonks GitHub Wiki
This is the class for Node objects. This class implements the Comparable interface.
Fields
- upperBound- Worst estimate for the current partial schedule node to reach the end.
- lowerBound- Best estimate for the current partial schedule node to reach the end.
List
- scheduledTasks- List of scheduled tasks.
HashMap
- scheduledTasksByProcessor - Maps a process number and its respective list of Tasks.
- unscheduledTasks - List of all unscheduled tasks for the node / schedule.
Method | Purpose |
---|---|
Node(Node node) | Constructor for Node class, takes an input node and copies the object. |
Task getTaskByNumber(Integer i) | Gets the task that corresponds to the input i from the scheduled task list. |
void addTasksToProcessor(Task task, int proc) | To add the inputs task and proc to the hash map scheduledTasksByProcessor . |
List getTasksForProcessor(int proc) | Returns the processor field of the task if there exists a list for the processor specified, else it returns a new list. |
int compareTo(Object node) | Override from the Comparable interface, used for the priority queue to know which node to place. |
void removeUnscheduledTask(Task task) | Removes the input task from the unscheduledTasks list. |