SOLA
|
Helper class to implement the pIA algorithm. A directed graph is layered into a free, second, and hidden layer. Prioritization is neglected in this modification of the algorithm. Therefore, all tasks from the free layer are automatically auctionable. More...
#include <layered_precedence_graph.h>
Public Member Functions | |
LayeredPrecedenceGraph (std::shared_ptr< material_flow::MFDLScheduler > scheduler, const std::string &connection_string) | |
void | next () |
Taking the next step in the algorithm. Updating the graph by assuming that all tasks of the free layer are now scheduled. Accordingly, layers from the second and hidden layer need to be updated. | |
std::vector< material_flow::Task > | getAuctionableTasks () const |
In this modification of pIA we do not consider prioritizations yet. Therefore, all free tasks are auctionable. | |
void | setEarliestValidStartTime (const std::string &task_uuid, const util::Duration &time) |
Setting the earliest valid start time, in pIA represented as PC[t], of a task. | |
void | setLatestFinishTime (const std::string &task_uuid, const util::Duration &time) |
Setting the latest finish time, in pIA represented as F[t], of a task. | |
util::Duration | getEarliestValidStartTime (const std::string &task_uuid) const |
util::Duration | getLatestFinishTime (const std::string &task_uuid) const |
material_flow::Task | getTask (const std::string &task_uuid) const |
bool | areAllTasksScheduled () const |
Checks whether all tasks are on the scheduled layer. The scheduled flag is not considered in this. | |
bool | areAllFreeTasksScheduled () const |
Checks whether for all free tasks the scheduled flag is set. If yes, this means that the iteration is finished. | |
void | setTaskScheduled (const std::string &task_uuid) |
Setting the scheduled flag of a task. | |
bool | isFreeTaskScheduled (const std::string &task_uuid) const |
Checking whether a free task has already been scheduled in this iteration before the layers get updated. | |
bool | isTaskFree (const std::string &task_uuid) const |
std::vector< material_flow::Task > | getTasks () const |
Helper class to implement the pIA algorithm. A directed graph is layered into a free, second, and hidden layer. Prioritization is neglected in this modification of the algorithm. Therefore, all tasks from the free layer are automatically auctionable.
The algorithm is based on the following paper: McIntire, Mitchell, Ernesto Nunes, and Maria Gini. "Iterated multi-robot auctions for precedence-constrained task scheduling." Proceedings of the 2016 international conference on autonomous agents & multiagent systems. 2016.
bool daisi::cpps::logical::LayeredPrecedenceGraph::areAllFreeTasksScheduled | ( | ) | const |
Checks whether for all free tasks the scheduled flag is set. If yes, this means that the iteration is finished.
bool daisi::cpps::logical::LayeredPrecedenceGraph::areAllTasksScheduled | ( | ) | const |
Checks whether all tasks are on the scheduled layer. The scheduled flag is not considered in this.
std::vector< daisi::material_flow::Task > daisi::cpps::logical::LayeredPrecedenceGraph::getAuctionableTasks | ( | ) | const |
In this modification of pIA we do not consider prioritizations yet. Therefore, all free tasks are auctionable.
bool daisi::cpps::logical::LayeredPrecedenceGraph::isFreeTaskScheduled | ( | const std::string & | task_uuid | ) | const |
Checking whether a free task has already been scheduled in this iteration before the layers get updated.
task_uuid | Uuid of the task we refer to |
void daisi::cpps::logical::LayeredPrecedenceGraph::next | ( | ) |
Taking the next step in the algorithm. Updating the graph by assuming that all tasks of the free layer are now scheduled. Accordingly, layers from the second and hidden layer need to be updated.
Implements pseudocode of Algorithm 2 "UpdatePrecGraph" from pIA paper All free tasks are scheduled.
void daisi::cpps::logical::LayeredPrecedenceGraph::setEarliestValidStartTime | ( | const std::string & | task_uuid, |
const util::Duration & | time | ||
) |
Setting the earliest valid start time, in pIA represented as PC[t], of a task.
task | Task to search for the according vertex |
time | Earliest valid start time |
void daisi::cpps::logical::LayeredPrecedenceGraph::setLatestFinishTime | ( | const std::string & | task_uuid, |
const util::Duration & | time | ||
) |
Setting the latest finish time, in pIA represented as F[t], of a task.
task | Task to search for the according vertex |
time | Earliest valid start time |
void daisi::cpps::logical::LayeredPrecedenceGraph::setTaskScheduled | ( | const std::string & | task_uuid | ) |
Setting the scheduled flag of a task.
task_uuid | Uuid of the task we refer to |