Eclipse SUMO - Simulation of Urban MObility
NIVissimConflictArea.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2002-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // -------------------
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
23 
24 #include <map>
25 #include <string>
27 #include "NIVissimConnection.h"
28 #include <netbuild/NBEdgeCont.h>
29 #include <netbuild/NBEdge.h>
30 #include <netbuild/NBNode.h>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
47 public:
49  NIVissimConflictArea(int id, const std::string& link1,
50  const std::string& link2,
51  const std::string& status);
52 
53 
56 
57 public:
60  static bool dictionary(int id, const std::string& link1,
61  const std::string& link2, const std::string& status);
62 
64  static bool dictionary(int id, NIVissimConflictArea* ca);
65 
67  static NIVissimConflictArea* dictionary(int id);
68 
71  static NIVissimConflictArea* dict_findByLinks(const std::string& link1,
72  const std::string& link2);
73 
75  static void clearDict();
76 
78  static std::map<int, NIVissimConflictArea*> getConflictAreas() {
79  return myDict;
80  }
81 
83  int getID() {
84  return myConflictID;
85  }
86 
88  std::string getFirstLink() {
89  return myFirstLink;
90  }
91 
93  std::string getSecondLink() {
94  return mySecondLink;
95  }
96 
98  std::string getStatus() {
99  return myStatus;
100  }
101 
103  static void setPriorityRegulation(NBEdgeCont& ec);
104 
105 
106 
107 private:
110 
112  std::string myFirstLink;
113 
115  std::string mySecondLink;
116 
118  std::string myStatus;
119 
120 private:
122  typedef std::map<int, NIVissimConflictArea*> DictType;
123 
125  static DictType myDict;
126 };
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:59
A temporary storage for conflict areas imported from Vissim.
std::string mySecondLink
The second link of the conflict area.
std::string myFirstLink
The first link of the conflict area.
std::string getStatus()
Returns the priority regulation of the conflic area.
int myConflictID
The id of the conflict area.
static bool dictionary(int id, const std::string &link1, const std::string &link2, const std::string &status)
Adds the described item to the dictionary Builds the conflict area first.
static void setPriorityRegulation(NBEdgeCont &ec)
Sets the priority regulation according to the VISSIM conflict area data.
static DictType myDict
The dictionary.
std::string getSecondLink()
Returns the second link of the conflic area.
static NIVissimConflictArea * dict_findByLinks(const std::string &link1, const std::string &link2)
static void clearDict()
Clears the dictionary.
std::string getFirstLink()
Returns the first link of the conflic area.
std::string myStatus
The priority regulation of the conflict area.
int getID()
Returns the ID of the conflic area.
NIVissimConflictArea(int id, const std::string &link1, const std::string &link2, const std::string &status)
Constructor.
std::map< int, NIVissimConflictArea * > DictType
Definition of the dictionary type.
static std::map< int, NIVissimConflictArea * > getConflictAreas()
Returns the dictionary including all conflict areas.