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.org/sumo
3 // Copyright (C) 2002-2019 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 /****************************************************************************/
14 // -------------------
15 /****************************************************************************/
16 #ifndef NIVissimConflictArea_h
17 #define NIVissimConflictArea_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 
26 #include <map>
27 #include <string>
29 #include "NIVissimConnection.h"
30 #include <netbuild/NBEdgeCont.h>
31 #include <netbuild/NBEdge.h>
32 #include <netbuild/NBNode.h>
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
49 public:
51  NIVissimConflictArea(int id, const std::string& link1,
52  const std::string& link2,
53  const std::string& status);
54 
55 
58 
59 public:
62  static bool dictionary(int id, const std::string& link1,
63  const std::string& link2, const std::string& status);
64 
66  static bool dictionary(int id, NIVissimConflictArea* ca);
67 
69  static NIVissimConflictArea* dictionary(int id);
70 
73  static NIVissimConflictArea* dict_findByLinks(const std::string& link1,
74  const std::string& link2);
75 
77  static void clearDict();
78 
80  static std::map<int, NIVissimConflictArea*> getConflictAreas() {
81  return myDict;
82  }
83 
85  int getID() {
86  return myConflictID;
87  }
88 
90  std::string getFirstLink() {
91  return myFirstLink;
92  }
93 
95  std::string getSecondLink() {
96  return mySecondLink;
97  }
98 
100  std::string getStatus() {
101  return myStatus;
102  }
103 
105  static void setPriorityRegulation(NBEdgeCont& ec);
106 
107 
108 
109 private:
112 
114  std::string myFirstLink;
115 
117  std::string mySecondLink;
118 
120  std::string myStatus;
121 
122 private:
124  typedef std::map<int, NIVissimConflictArea*> DictType;
125 
127  static DictType myDict;
128 };
129 
130 
131 #endif
132 
133 /****************************************************************************/
NIVissimConflictArea::dict_findByLinks
static NIVissimConflictArea * dict_findByLinks(const std::string &link1, const std::string &link2)
Definition: NIVissimConflictArea.cpp:95
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:60
NIVissimConflictArea::myDict
static DictType myDict
The dictionary.
Definition: NIVissimConflictArea.h:127
NBEdgeCont.h
NIVissimConflictArea::getFirstLink
std::string getFirstLink()
Returns the first link of the conflic area.
Definition: NIVissimConflictArea.h:90
NIVissimConflictArea::getSecondLink
std::string getSecondLink()
Returns the second link of the conflic area.
Definition: NIVissimConflictArea.h:95
NIVissimConflictArea::myStatus
std::string myStatus
The priority regulation of the conflict area.
Definition: NIVissimConflictArea.h:120
NIVissimConflictArea::DictType
std::map< int, NIVissimConflictArea * > DictType
Definition of the dictionary type.
Definition: NIVissimConflictArea.h:124
NIVissimConflictArea::myConflictID
int myConflictID
The id of the conflict area.
Definition: NIVissimConflictArea.h:111
NIVissimConflictArea::NIVissimConflictArea
NIVissimConflictArea(int id, const std::string &link1, const std::string &link2, const std::string &status)
Constructor.
Definition: NIVissimConflictArea.cpp:44
NIVissimConflictArea::myFirstLink
std::string myFirstLink
The first link of the conflict area.
Definition: NIVissimConflictArea.h:114
NIVissimConflictArea::getStatus
std::string getStatus()
Returns the priority regulation of the conflic area.
Definition: NIVissimConflictArea.h:100
NIVissimConflictArea
A temporary storage for conflict areas imported from Vissim.
Definition: NIVissimConflictArea.h:48
NIVissimConflictArea::dictionary
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.
Definition: NIVissimConflictArea.cpp:58
NIVissimConflictArea::getID
int getID()
Returns the ID of the conflic area.
Definition: NIVissimConflictArea.h:85
StringUtils.h
NIVissimConnection.h
NIVissimConflictArea::mySecondLink
std::string mySecondLink
The second link of the conflict area.
Definition: NIVissimConflictArea.h:117
NIVissimConflictArea::getConflictAreas
static std::map< int, NIVissimConflictArea * > getConflictAreas()
Returns the dictionary including all conflict areas.
Definition: NIVissimConflictArea.h:80
config.h
NIVissimConflictArea::setPriorityRegulation
static void setPriorityRegulation(NBEdgeCont &ec)
Sets the priority regulation according to the VISSIM conflict area data.
Definition: NIVissimConflictArea.cpp:117
NBNode.h
NIVissimConflictArea::~NIVissimConflictArea
~NIVissimConflictArea()
Destructor.
Definition: NIVissimConflictArea.cpp:52
NIVissimConflictArea::clearDict
static void clearDict()
Clears the dictionary.
Definition: NIVissimConflictArea.cpp:108
NBEdge.h