17#ifndef DAISI_PATH_PLANNING_CONSENSUS_PAXOS_DATA_H_
18#define DAISI_PATH_PLANNING_CONSENSUS_PAXOS_DATA_H_
22#include "path_planning/constants.h"
23#include "path_planning/path_planning_logger_ns_3.h"
24#include "path_planning/station.h"
25#include "sola-ns3/sola_ns3_wrapper.h"
27namespace daisi::path_planning::consensus {
29using InstanceID = uint32_t;
30using RequestID = std::pair<uint32_t, uint32_t>;
33 uint32_t instance_id = 0;
34 uint32_t proposal_id = 0;
35 uint32_t station_id = 0;
36 std::vector<IntersectionTimeInfo> data;
38 [[nodiscard]]
bool initialized()
const {
return !data.empty(); }
42 PaxosContainer(std::shared_ptr<sola_ns3::SOLAWrapperNs3> sola, uint32_t node_id,
43 PaxosSettings settings, std::shared_ptr<PathPlanningLoggerNs3> logger)
44 : sola(std::move(sola)),
46 settings(std::move(settings)),
47 logger(std::move(logger)) {}
48 const std::shared_ptr<sola_ns3::SOLAWrapperNs3> sola{};
49 const uint32_t node_id;
51 std::shared_ptr<PathPlanningLoggerNs3> logger;
53 std::unordered_map<InstanceID, RequestID>
60 std::vector<std::vector<IntersectionTimeInfo>>
Definition paxos_data.h:32
Definition paxos_data.h:41
AcceptedProposal accepted_data_current_instance
Definition paxos_data.h:57
std::unordered_map< InstanceID, RequestID > instance_to_promised
Definition paxos_data.h:54
IntersectionOccupancy agreed_data
Definition paxos_data.h:65
std::vector< std::vector< IntersectionTimeInfo > > finally_accepted_data
Definition paxos_data.h:61
Definition paxos_settings.h:23