SOLA
Loading...
Searching...
No Matches
layered_precedence_graph_components.h
1// Copyright 2023 The SOLA authors
2//
3// This file is part of DAISI.
4//
5// DAISI is free software: you can redistribute it and/or modify it under the terms of the GNU
6// General Public License as published by the Free Software Foundation; version 2.
7//
8// DAISI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10// Public License for more details.
11//
12// You should have received a copy of the GNU General Public License along with DAISI. If not, see
13// <https://www.gnu.org/licenses/>.
14//
15// SPDX-License-Identifier: GPL-2.0-only
16
17#ifndef DAISI_CPPS_LOGICAL_ALGORITHMS_ASSIGNMENT_LAYERED_PRECEDENCE_GRAPH_COMPONENTS_H_
18#define DAISI_CPPS_LOGICAL_ALGORITHMS_ASSIGNMENT_LAYERED_PRECEDENCE_GRAPH_COMPONENTS_H_
19
20#include <memory>
21#include <optional>
22
23#include "datastructure/directed_graph.tpp"
24#include "material_flow/model/material_flow.h"
25#include "utils/structure_helpers.h"
26
27namespace daisi::cpps::logical {
28
32enum class PrecedenceGraphLayer { kFree, kSecond, kHidden, kScheduled, kNone };
33
34struct LPCVertex {
37 explicit LPCVertex(material_flow::Task task) : task(std::move(task)){};
38
42
44 PrecedenceGraphLayer layer = PrecedenceGraphLayer::kNone;
45
48 std::optional<util::Duration> latest_finish = std::nullopt;
49
53 std::optional<util::Duration> earliest_valid_start = std::nullopt;
54
57 bool scheduled = false;
58
59 friend bool operator==(const LPCVertex &v1, const LPCVertex &v2) { return v1.task == v2.task; }
60
61 friend bool operator!=(const LPCVertex &v1, const LPCVertex &v2) { return v1.task != v2.task; }
62};
63
64} // namespace daisi::cpps::logical
65
66#endif
Definition task.h:34
Modified Round Robin Algorithm that centrally assigns tasks of incoming material flows to the corresp...
Definition algorithm_config.h:22
PrecedenceGraphLayer
Enum to represent the different layers tasks can be on in this precedence graph. The free layer is al...
Definition layered_precedence_graph_components.h:32
Definition layered_precedence_graph_components.h:34
std::optional< util::Duration > latest_finish
F[t] in pIA; latest finish time of tasks that have been scheduled. std::nullopt otherwise.
Definition layered_precedence_graph_components.h:48
std::optional< util::Duration > earliest_valid_start
PC[t] in pIA; earliest valid start time of tasks whose predecessors have been scheduled....
Definition layered_precedence_graph_components.h:53
PrecedenceGraphLayer layer
Assigning a layer to the task as presented by the set formulations in pIA.
Definition layered_precedence_graph_components.h:44
bool scheduled
Flag representing that a free task has been already scheduled. The flag is not used outside of free l...
Definition layered_precedence_graph_components.h:57
LPCVertex(material_flow::Task task)
Initializing the vertex by setting the task and everything else as invalid.
Definition layered_precedence_graph_components.h:37
material_flow::Task task
The task this vertex represents by giving it additional information for auction and about the layer.
Definition layered_precedence_graph_components.h:41