SOLA
Loading...
Searching...
No Matches
amr_logical_execution_state.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_AMR_AMR_LOGICAL_EXECUTION_STATE_H_
18#define DAISI_CPPS_LOGICAL_AMR_AMR_LOGICAL_EXECUTION_STATE_H_
19
20#include "cpps/amr/message/amr_order_update.h"
21#include "cpps/amr/message/amr_status_update.h"
22#include "material_flow/model/task.h"
23
24namespace daisi::cpps::logical {
25
27public:
28 void processAmrStatusUpdate(const AmrStatusUpdate &amr_status_update);
29 void processAmrOrderUpdate(const AmrOrderUpdate &amr_order_update);
30 bool shouldSendNextTaskToPhysical() const;
31
32 const util::Position &getPosition() const;
33 const AmrState &getAmrState() const;
34 const material_flow::Task &getTask() const;
35 const int &getOrderIndex() const;
36 const OrderStates &getOrderState() const;
37
38 void setNextTask(const material_flow::Task &next_task);
39
40private:
41 void setNextOrder();
42
43 util::Position position_;
44 AmrState amr_state_ = AmrState::kIdle;
46 int order_index_ = -1;
47 OrderStates order_state_ = OrderStates::kCreated;
48
49 bool send_next_task_to_physical_ = true;
50};
51
52} // namespace daisi::cpps::logical
53
54#endif
Definition amr_order_update.h:25
Definition amr_status_update.h:26
Definition amr_logical_execution_state.h:26
Definition task.h:34
Modified Round Robin Algorithm that centrally assigns tasks of incoming material flows to the corresp...
Definition algorithm_config.h:22