SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NIVissimConflictArea.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // -------------------
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2002-2016 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef NIVissimConflictArea_h
21 #define NIVissimConflictArea_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 
34 #include <map>
35 #include <string>
37 #include "NIVissimConnection.h"
38 #include <netbuild/NBEdgeCont.h>
39 #include <netbuild/NBEdge.h>
40 #include <netbuild/NBNode.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
57 public:
59  NIVissimConflictArea(int id, const std::string& link1,
60  const std::string& link2,
61  const std::string& status);
62 
63 
66 
67 public:
70  static bool dictionary(int id, const std::string& link1,
71  const std::string& link2, const std::string& status);
72 
74  static bool dictionary(int id, NIVissimConflictArea* ca);
75 
77  static NIVissimConflictArea* dictionary(int id);
78 
81  static NIVissimConflictArea* dict_findByLinks(const std::string& link1,
82  const std::string& link2);
83 
85  static void clearDict();
86 
88  static std::map<int, NIVissimConflictArea*> getConflictAreas() {
89  return myDict;
90  }
91 
93  int getID() {
94  return myConflictID;
95  }
96 
98  std::string getFirstLink() {
99  return myFirstLink;
100  }
101 
103  std::string getSecondLink() {
104  return mySecondLink;
105  }
106 
108  std::string getStatus() {
109  return myStatus;
110  }
111 
113  static void setPriorityRegulation(NBEdgeCont& ec);
114 
115 
116 
117 private:
120 
122  std::string myFirstLink;
123 
125  std::string mySecondLink;
126 
128  std::string myStatus;
129 
130 private:
132  typedef std::map<int, NIVissimConflictArea*> DictType;
133 
135  static DictType myDict;
136 };
137 
138 
139 #endif
140 
141 /****************************************************************************/
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.