C++ Reference: class TaskSet

This documentation is automatically generated.

Helper class to compute the end-min of a set of tasks given their start-min and duration-min. In Petr Vilim's PhD "Global Constraints in Scheduling", this corresponds to his Theta-tree except that we use a O(n) implementation for most of the function here, not a O(log(n)) one.
Method
AddEntry

Return type: void

Arguments: const Entry& e

AddUnsortedEntry

Return type: void

Arguments: const Entry& e

Advanced usage. Instead of calling many AddEntry(), it is more efficient to call AddUnsortedEntry() instead, but then Sort() MUST be called just after the insertions. Nothing is checked here, so it is up to the client to do that properly.

Clear

Return type: void

Insertion and modification. These leave sorted_tasks_ sorted.

ComputeEndMin

Return type: IntegerValue

Arguments: int task_to_ignore, int* critical_index

Returns the end-min for the task in the set. The time profile of the tasks packed to the left will always be a set of contiguous tasks separated by empty space: [Bunch of tasks] ... [Bunch of tasks] ... [critical tasks]. We call "critical tasks" the last group. These tasks will be solely responsible for for the end-min of the whole set. The returned critical_index will be the index of the first critical task in SortedTasks(). A reason for the min end is: - The duration-min of all the critical tasks. - The fact that all critical tasks have a start-min greater or equal to the first of them, that is SortedTasks()[critical_index].start_min. It is possible to behave like if one task was not in the set by setting task_to_ignore to the id of this task. This returns 0 if the set is empty in which case critical_index will be left unchanged.

ComputeEndMin

Return type: IntegerValue

GetCriticalIndex

Return type: int

Warning, this is only valid if ComputeEndMin() was just called. It is the same index as if one called ComputeEndMin(-1, &critical_index), but saves another unneeded loop.

NotifyEntryIsNowLastIfPresent

Return type: void

Arguments: const Entry& e

Advanced usage, if the entry is present, this assumes that its start_min is >= the end min without it, and update the datastructure accordingly.

RemoveEntryWithIndex

Return type: void

Arguments: int index

Sort

Return type: void

SortedTasks

Return type: const std::vector<Entry>&

TaskSet

Return type: explicit

Arguments: int num_tasks