SOLA
Loading...
Searching...
No Matches
constants.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_CONSTANTS_H_
18#define DAISI_PATH_PLANNING_CONSTANTS_H_
19
20#include <unordered_map>
21#include <utility>
22#include <variant>
23#include <vector>
24
25#include "ns3/vector.h"
26#include "path_planning/consensus/central/central_settings.h"
27#include "path_planning/consensus/paxos/paxos_settings.h"
28
29namespace daisi::path_planning {
30
32using PointTimePairs = std::vector<std::pair<ns3::Vector2D, double>>;
33
35using PPVector = std::pair<float, float>;
36
37using Timestamp = double;
38using Intersection = PPVector;
39using ID = uint32_t;
40
43using IntersectionOccupancy = std::unordered_map<Intersection, std::map<Timestamp, ID>>;
44} // namespace daisi::path_planning
45
46namespace std {
47template <> struct hash<daisi::path_planning::PPVector> {
49 size_t operator()(daisi::path_planning::PPVector const &p) const {
50 return std::hash<double>()(p.first) ^ std::hash<double>()(p.second);
51 }
52};
53} // namespace std
54
55#endif // DAISI_PATH_PLANNING_CONSTANTS_H_
size_t operator()(daisi::path_planning::PPVector const &p) const
Hash function for PPVector.
Definition constants.h:49