SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NIVissimTL.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // -------------------
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 NIVissimTL_h
22 #define NIVissimTL_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 
35 #include <map>
36 #include <string>
37 #include <vector>
40 #include <utils/common/SUMOTime.h>
41 
42 
44 
45 
46 
47 // ===========================================================================
48 // class declarations
49 // ===========================================================================
50 class NBLoadedTLDef;
51 class NBEdgeCont;
52 
53 class NIVissimTL {
54 public:
55  NIVissimTL(int id, const std::string& type, const std::string& name,
56  SUMOTime absdur, SUMOTime offset);
57  ~NIVissimTL();
58 // void computeBounding();
59  std::string getType() const;
60  int getID() const;
61 
62 public:
63  static bool dictionary(int id, const std::string& type,
64  const std::string& name, SUMOTime absdur, SUMOTime offset);
65  static bool dictionary(int id, NIVissimTL* o);
66  static NIVissimTL* dictionary(int id);
67 // static std::vector<int> getWithin(const AbstractPoly &poly, SUMOReal offset);
68  static void clearDict();
70  NBEdgeCont& ec);
71 
72 public:
73  class NIVissimTLSignal;
75  typedef std::map<int, NIVissimTLSignal*> SSignalDictType;
76  typedef std::map<int, NIVissimTLSignalGroup*> SGroupDictType;
77  typedef std::map<int, SSignalDictType> SignalDictType;
78  typedef std::map<int, SGroupDictType> GroupDictType;
79 
84  public:
85  NIVissimTLSignal(int lsaid, int id, const std::string& name,
86  const std::vector<int>& groupids, int edgeid, int laneno,
87  SUMOReal position, const std::vector<int>& assignedVehicleTypes);
89  bool isWithin(const PositionVector& poly) const;
90  Position getPosition() const;
91  bool addTo(NBEdgeCont& ec, NBLoadedTLDef* node) const;
92 
93  public:
94  static bool dictionary(int lsaid, int id, NIVissimTLSignal* o);
95  static NIVissimTLSignal* dictionary(int lsaid, int id);
96  static void clearDict();
97  static SSignalDictType getSignalsFor(int tlid);
98 
99  protected:
100  int myLSA;
101  int myID;
102  std::string myName;
103  std::vector<int> myGroupIDs;
104  int myEdgeID;
105  int myLane;
107  std::vector<int> myVehicleTypes;
109  };
110 
112  public:
113  NIVissimTLSignalGroup(int lsaid, int id, const std::string& name,
114  bool isGreenBegin, const std::vector<SUMOReal>& times,
115  SUMOTime tredyellow, SUMOTime tyellow);
117  bool addTo(NBLoadedTLDef* node) const;
118  public:
119  static bool dictionary(int lsaid, int id, NIVissimTLSignalGroup* o);
120  static NIVissimTLSignalGroup* dictionary(int lsaid, int id);
121  static void clearDict();
122  static SGroupDictType getGroupsFor(int tlid);
123 
124  private:
125  int myLSA;
126  int myID;
127  std::string myName;
128  std::vector<SUMOReal> myTimes;
132  };
133 
134 protected:
135  int myID;
136  std::string myName;
140  std::string myType;
141 private:
142  typedef std::map<int, NIVissimTL*> DictType;
143  static DictType myDict;
144 };
145 
146 
147 #endif
148 
149 /****************************************************************************/
150