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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // -------------------
18 /****************************************************************************/
19 #ifndef NIVissimConflictArea_h
20 #define NIVissimConflictArea_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 
33 #include <map>
34 #include <string>
36 #include "NIVissimConnection.h"
37 #include <netbuild/NBEdgeCont.h>
38 #include <netbuild/NBEdge.h>
39 #include <netbuild/NBNode.h>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
56 public:
58  NIVissimConflictArea(int id, const std::string& link1,
59  const std::string& link2,
60  const std::string& status);
61 
62 
65 
66 public:
69  static bool dictionary(int id, const std::string& link1,
70  const std::string& link2, const std::string& status);
71 
73  static bool dictionary(int id, NIVissimConflictArea* ca);
74 
76  static NIVissimConflictArea* dictionary(int id);
77 
80  static NIVissimConflictArea* dict_findByLinks(const std::string& link1,
81  const std::string& link2);
82 
84  static void clearDict();
85 
87  static std::map<int, NIVissimConflictArea*> getConflictAreas() {
88  return myDict;
89  }
90 
92  int getID() {
93  return myConflictID;
94  }
95 
97  std::string getFirstLink() {
98  return myFirstLink;
99  }
100 
102  std::string getSecondLink() {
103  return mySecondLink;
104  }
105 
107  std::string getStatus() {
108  return myStatus;
109  }
110 
112  static void setPriorityRegulation(NBEdgeCont& ec);
113 
114 
115 
116 private:
119 
121  std::string myFirstLink;
122 
124  std::string mySecondLink;
125 
127  std::string myStatus;
128 
129 private:
131  typedef std::map<int, NIVissimConflictArea*> DictType;
132 
134  static DictType myDict;
135 };
136 
137 
138 #endif
139 
140 /****************************************************************************/
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:66
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.