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.org/sumo
3 // Copyright (C) 2002-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // -------------------
16 /****************************************************************************/
17 #ifndef NIVissimConflictArea_h
18 #define NIVissimConflictArea_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 
27 #include <map>
28 #include <string>
30 #include "NIVissimConnection.h"
31 #include <netbuild/NBEdgeCont.h>
32 #include <netbuild/NBEdge.h>
33 #include <netbuild/NBNode.h>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
50 public:
52  NIVissimConflictArea(int id, const std::string& link1,
53  const std::string& link2,
54  const std::string& status);
55 
56 
59 
60 public:
63  static bool dictionary(int id, const std::string& link1,
64  const std::string& link2, const std::string& status);
65 
67  static bool dictionary(int id, NIVissimConflictArea* ca);
68 
70  static NIVissimConflictArea* dictionary(int id);
71 
74  static NIVissimConflictArea* dict_findByLinks(const std::string& link1,
75  const std::string& link2);
76 
78  static void clearDict();
79 
81  static std::map<int, NIVissimConflictArea*> getConflictAreas() {
82  return myDict;
83  }
84 
86  int getID() {
87  return myConflictID;
88  }
89 
91  std::string getFirstLink() {
92  return myFirstLink;
93  }
94 
96  std::string getSecondLink() {
97  return mySecondLink;
98  }
99 
101  std::string getStatus() {
102  return myStatus;
103  }
104 
106  static void setPriorityRegulation(NBEdgeCont& ec);
107 
108 
109 
110 private:
113 
115  std::string myFirstLink;
116 
118  std::string mySecondLink;
119 
121  std::string myStatus;
122 
123 private:
125  typedef std::map<int, NIVissimConflictArea*> DictType;
126 
128  static DictType myDict;
129 };
130 
131 
132 #endif
133 
134 /****************************************************************************/
std::string getStatus()
Returns the priority regulation of the conflic 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.
std::string myFirstLink
The first link of the conflict area.
static std::map< int, NIVissimConflictArea * > getConflictAreas()
Returns the dictionary including all conflict areas.
~NIVissimConflictArea()
Destructor.
int getID()
Returns the ID of the conflic area.
static void setPriorityRegulation(NBEdgeCont &ec)
Sets the priority regulation according to the VISSIM conflict area data.
static NIVissimConflictArea * dict_findByLinks(const std::string &link1, const std::string &link2)
std::string mySecondLink
The second link of the conflict area.
static void clearDict()
Clears the dictionary.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
std::string getSecondLink()
Returns the second link of the conflic area.
NIVissimConflictArea(int id, const std::string &link1, const std::string &link2, const std::string &status)
Constructor.
static DictType myDict
The dictionary.
int myConflictID
The id of the conflict area.
A temporary storage for conflict areas imported from Vissim.
std::string getFirstLink()
Returns the first link of the conflic area.
std::string myStatus
The priority regulation of the conflict area.
std::map< int, NIVissimConflictArea * > DictType
Definition of the dictionary type.