SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSOffTrafficLightLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // A traffic lights logic which represents a tls in an off-mode
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef MSOffTrafficLightLogic_h
23 #define MSOffTrafficLightLogic_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <utility>
36 #include <vector>
37 #include <bitset>
39 #include <microsim/MSNet.h>
40 #include <utils/common/StdDefs.h>
41 #include "MSTrafficLightLogic.h"
42 #include "MSPhaseDefinition.h"
43 #include "MSTLLogicControl.h"
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
54 public:
61  const std::string& id);
62 
63 
68  virtual void init(NLDetectorBuilder& nb);
69 
70 
73 
74 
77 
84 
85 
86 
89 
95  SUMOTime trySwitch(bool isActive) {
96  UNUSED_PARAMETER(isActive);
97  return 120 * DELTA_T;
98  }
99 
101 
102 
105 
110  unsigned int getPhaseNumber() const;
111 
112 
117  const Phases& getPhases() const;
118 
119 
125  const MSPhaseDefinition& getPhase(unsigned int givenstep) const;
127 
128 
129 
132 
137  unsigned int getCurrentPhaseIndex() const;
138 
139 
144  const MSPhaseDefinition& getCurrentPhaseDef() const;
146 
147 
148 
151 
156  SUMOTime getPhaseIndexAtTime(SUMOTime simStep) const;
157 
158 
164  SUMOTime getOffsetFromIndex(unsigned int index) const;
165 
166 
172  unsigned int getIndexFromOffset(SUMOTime offset) const;
174 
175 
176 
179 
187  void changeStepAndDuration(MSTLLogicControl& tlcontrol, SUMOTime simStep, unsigned int step, SUMOTime stepDuration) {
188  UNUSED_PARAMETER(tlcontrol);
189  UNUSED_PARAMETER(simStep);
190  UNUSED_PARAMETER(step);
191  UNUSED_PARAMETER(stepDuration);
192  }
194 
195 
196 private:
199  void rebuildPhase();
200 
201 
202 private:
205 
206 
207 };
208 
209 
210 #endif
211 
212 /****************************************************************************/
213