Model . Node - SeanSpires/Project1-306-Team-Stonks GitHub Wiki

Node Methods

This is the class for Node objects. This class implements the Comparable interface.

Fields

  1. upperBound- Worst estimate for the current partial schedule node to reach the end.
  2. lowerBound- Best estimate for the current partial schedule node to reach the end.

List

  1. scheduledTasks- List of scheduled tasks.

HashMap

  1. scheduledTasksByProcessor - Maps a process number and its respective list of Tasks.
  2. 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.
⚠️ **GitHub.com Fallback** ⚠️