SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NIVissimDistrictConnection.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // An edge imported from Vissim together for a container for
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef NIVissimDistrictConnection_h
22 #define NIVissimDistrictConnection_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <map>
35 #include <string>
36 #include <utils/geom/Position.h>
37 
38 
39 class NBDistrictCont;
40 class NBEdgeCont;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
47 public:
49  NIVissimDistrictConnection(int id, const std::string& name,
50  const std::vector<int>& districts, const std::vector<SUMOReal>& percentages,
51  int edgeid, SUMOReal position,
52  const std::vector<std::pair<int, int> >& assignedVehicles);
53 
54  // Destructor
56 
59  Position geomPosition() const;
60 
62  int getID() const {
63  return myID;
64  }
65 
68  return myPosition;
69  }
70 
71  SUMOReal getMeanSpeed(/*NBDistribution &dc*/) const;
72 
73 public:
75  static bool dictionary(int id, const std::string& name,
76  const std::vector<int>& districts, const std::vector<SUMOReal>& percentages,
77  int edgeid, SUMOReal position,
78  const std::vector<std::pair<int, int> >& assignedVehicles);
79 
81  static bool dictionary(int id, NIVissimDistrictConnection* o);
82 
84  static NIVissimDistrictConnection* dictionary(int id);
85 
88  NBNodeCont& nc);
89 
91  static void dict_BuildDistricts(NBDistrictCont& dc,
92  NBEdgeCont& ec, NBNodeCont& nc/*, NBDistribution &distc*/);
93 
96  static NIVissimDistrictConnection* dict_findForEdge(int edgeid);
97 
99  static void clearDict();
100 
101  static void dict_BuildDistrictConnections();
102 
103  static void dict_CheckEdgeEnds();
104 
105 
106 private:
107  void checkEdgeEnd();
108  SUMOReal getRealSpeed(/*NBDistribution &dc, */int distNo) const;
109 
110 private:
112  int myID;
113 
115  std::string myName;
116 
118  std::vector<int> myDistricts;
119 
121  typedef std::map<int, SUMOReal> DistrictPercentages;
122 
125 
127  int myEdgeID;
128 
131 
133  std::vector<std::pair<int, int> > myAssignedVehicles;
134 
135 private:
137  typedef std::map<int, NIVissimDistrictConnection*> DictType;
138 
140  static DictType myDict;
141 
143  static std::map<int, std::vector<int> > myDistrictsConnections;
144 
145 };
146 
147 
148 #endif
149 
150 /****************************************************************************/
151