SOLA
Loading...
Searching...
No Matches
delivery_station.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_PATH_PLANNING_DELIVERY_STATION_H_
18#define DAISI_PATH_PLANNING_DELIVERY_STATION_H_
19
20#include "agv_info.h"
21#include "agv_queue.h"
22#include "ns3/vector.h"
23#include "path_planning/consensus/consensus_types.h"
24#include "path_planning/consensus/constants.h"
25#include "path_planning/consensus/paxos/message/accept_message.h"
26#include "path_planning/consensus/paxos/message/ok_message.h"
27#include "path_planning/consensus/paxos/message/prepare_message.h"
28#include "path_planning/consensus/paxos/message/promise_message.h"
29#include "path_planning/consensus/paxos/paxos_replication_manager.h"
30#include "path_planning/path_planning_logger_ns_3.h"
31#include "sola-ns3/sola_ns3_wrapper.h"
32#include "station.h"
33
34namespace daisi::path_planning {
35
39public:
40 DeliveryStation(DeliveryStationInfo info, consensus::ConsensusSettings consensus_settings,
41 std::shared_ptr<PathPlanningLoggerNs3> logger, uint32_t device_id);
42 void postInit();
43
44 std::string getConnectionString() const { return sola_->getConectionString(); }
45
46 DeliveryStationInfo getStationInfo() const { return info_; }
47
48 std::string getFullName() const;
49
50private:
51 const uint32_t device_id_ = 0;
53
54 consensus::ConsensusSettings consensus_settings_;
55 std::optional<consensus::PaxosReplicationManager> replication_manager_;
56
57 std::shared_ptr<PathPlanningLoggerNs3> logger_;
58 std::shared_ptr<sola_ns3::SOLAWrapperNs3> sola_;
59 void processTopicMessage(const sola::TopicMessage &message);
60
62 void initReplication();
63
65 void init();
66};
67
68} // namespace daisi::path_planning
69#endif // DAISI_PATH_PLANNING_DELIVERY_STATION_H_
Definition delivery_station.h:38
Definition message.h:20