17#ifndef DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_STN_TASK_MANAGEMENT_H_
18#define DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_STN_TASK_MANAGEMENT_H_
22#include "auction_based_task_management.h"
23#include "cpps/amr/amr_mobility_helper.h"
24#include "cpps/amr/physical/material_flow_functionality_mapping.h"
25#include "datastructure/simple_temporal_network.tpp"
26#include "stn_task_management_components.h"
33 StnTaskManagementEdge> {
37 std::optional<StnTaskManagementVertex> next_start;
61 std::shared_ptr<InsertionPoint> insertion_point =
nullptr)
override;
68 std::shared_ptr<InsertionPoint> insertion_point =
nullptr)
override;
79 using VertexIterator = std::vector<StnTaskManagementVertex>::iterator;
86 std::vector<daisi::material_flow::Location> end_locations;
97 std::optional<daisi::material_flow::Location> current_task_end_location_;
99 daisi::util::Duration current_task_expected_finish_time_ = 0.0;
101 std::vector<TaskInsertInfo> current_ordering_;
103 Metrics current_total_metrics_;
105 std::vector<TaskInsertInfo>::iterator newest_task_insert_info_;
107 daisi::util::Duration time_now_ = 0;
109 std::optional<std::pair<MetricsComposition, std::shared_ptr<InsertionPoint>>>
110 latest_calculated_insertion_info_;
112 bool solve()
override;
115 const std::string &precedence_task_name);
119 const daisi::material_flow::Order &order,
122 void updateGetToStartDurationConstraint(
int task_index_to_update);
124 util::Duration calcGetToStartDuration(
int task_index_to_update);
129 std::optional<std::pair<MetricsComposition, std::shared_ptr<StnInsertionPoint>>> addBestOrdering(
132 std::vector<StnInsertionPoint> calcInsertionPoints();
138 daisi::util::Position getLastPositionBefore(
int task_index);
140 daisi::util::Duration calcOrderDurationForInsert(
const daisi::material_flow::Order &order,
152 int task_ordering_index);
155 VertexIterator getVertexIteratorOfOrder(
const daisi::material_flow::Order &order,
bool start);
156 int getVertexIndexOfOrder(
const daisi::material_flow::Order &order,
bool start);
161 void updateOriginConstraints(
const daisi::util::Duration &time_difference);
Definition amr_description.h:27
Definition amr_topology.h:26
Definition auction_based_task_management.h:25
Definition metrics_composition.h:25
Definition stn_task_management.h:33
std::optional< daisi::material_flow::Task > current_task_
Definition stn_task_management.h:95
bool addTask(const daisi::material_flow::Task &task, std::shared_ptr< InsertionPoint > insertion_point=nullptr) override
assign a new task to the management
Definition stn_task_management.cpp:136
bool hasTasks() const override
check wether the task management has a current task assigned
Definition stn_task_management.cpp:84
void setCurrentTime(const daisi::util::Duration &now)
set the management's current time
Definition stn_task_management.cpp:38
bool setNextTask() override
set the current task to the first task that is currently queued
Definition stn_task_management.cpp:93
void updateCurrentOrdering()
update the metrics compositions of all currently queued tasks as well as the total metrics....
Definition stn_task_management.cpp:294
bool canAddTask(const daisi::material_flow::Task &task, std::shared_ptr< InsertionPoint > insertion_point=nullptr) override
check wether a new task can be assigned to the management
Definition stn_task_management.cpp:120
std::pair< MetricsComposition, std::shared_ptr< InsertionPoint > > getLatestCalculatedInsertionInfo() const override
get infos about the latest task insertion (also includes the check wether a task can be inserted)
Definition stn_task_management.cpp:572
daisi::material_flow::Task getCurrentTask() const override
get the current task
Definition stn_task_management.cpp:86
void insertOrderPropertiesIntoMetrics(const daisi::material_flow::Order &order, Metrics &metrics, const TaskInsertInfo &task_insert_info, int task_ordering_index)
calculate the metrics for the given order of the given task and insert them into the given metrics.
Definition stn_task_management.cpp:463
Definition simple_temporal_network.h:27
Modified Round Robin Algorithm that centrally assigns tasks of incoming material flows to the corresp...
Definition algorithm_config.h:22
Definition auction_based_task_management.h:27
Definition stn_task_management_components.h:29
Definition stn_task_management.h:35
contains a task, the end locations, and metrics compositions for the single orders
Definition stn_task_management.h:82
Definition structure_helpers.h:64