SOLA
Loading...
Searching...
No Matches
simple_task_management.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_TASK_MANAGEMENT_SIMPLE_TASK_MANAGEMENT_H_
18#define DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_SIMPLE_TASK_MANAGEMENT_H_
19
20#include "cpps/amr/amr_mobility_helper.h"
21#include "cpps/amr/physical/material_flow_functionality_mapping.h"
22#include "task_management.h"
23
24namespace daisi::cpps::logical {
26public:
27 SimpleTaskManagement(const AmrDescription &amr_description, const Topology &topology,
28 const daisi::util::Pose &pose);
29
30 ~SimpleTaskManagement() override = default;
31
35
37 daisi::util::Position getExpectedEndPosition() const;
38
40 bool hasTasks() const override;
41
44
48 bool setNextTask() override;
49
51 bool canAddTask(const daisi::material_flow::Task &task) override;
52
55 bool addTask(const daisi::material_flow::Task &task) override;
56
57 void setCurrentTime(const daisi::util::Duration &now);
58
59private:
63 void updateFinalMetrics();
64
71 void insertOrderPropertiesIntoMetrics(const daisi::material_flow::Order &order, Metrics &metrics,
73 const daisi::util::Duration &start_time) const;
74
76 std::optional<daisi::material_flow::Task> active_task_;
77
79 std::vector<daisi::material_flow::Task> queue_;
80
82 Metrics final_metrics_;
83
85 std::optional<daisi::util::Position> expected_end_position_;
86
88 daisi::util::Duration time_now_ = 0;
89};
90
91} // namespace daisi::cpps::logical
92
93#endif
Definition amr_description.h:27
Definition amr_topology.h:26
Definition metrics.h:28
Definition simple_task_management.h:25
bool hasTasks() const override
check wether the task management has a current task assigned
Definition simple_task_management.cpp:44
Metrics getFinalMetrics() const
return the metrics of the final order contained in the last task that has been added to the managemen...
Definition simple_task_management.cpp:28
bool canAddTask(const daisi::material_flow::Task &task) override
check wether a new task can be added to the management's queue
Definition simple_task_management.cpp:63
daisi::util::Position getExpectedEndPosition() const
return the end position after executing the final task in the queue
Definition simple_task_management.cpp:30
bool setNextTask() override
replace the current task with the first task stored in the management's queue
Definition simple_task_management.cpp:53
bool addTask(const daisi::material_flow::Task &task) override
insert a task into the management's queue. Update the current metrics and end location.
Definition simple_task_management.cpp:70
daisi::material_flow::Task getCurrentTask() const override
get the current task
Definition simple_task_management.cpp:46
Definition task_management.h:35
Definition task.h:34
Modified Round Robin Algorithm that centrally assigns tasks of incoming material flows to the corresp...
Definition algorithm_config.h:22
Definition structure_helpers.h:64