SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSOffTrafficLightLogic.cpp
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.sourceforge.net/
12 // Copyright (C) 2001-2012 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 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #include <utility>
32 #include <vector>
33 #include <bitset>
34 #include <sstream>
36 #include "MSTrafficLightLogic.h"
37 #include "MSOffTrafficLightLogic.h"
38 
39 #ifdef CHECK_MEMORY_LEAKS
40 #include <foreign/nvwa/debug_new.h>
41 #endif // CHECK_MEMORY_LEAKS
42 
43 
44 // ===========================================================================
45 // member method definitions
46 // ===========================================================================
48  const std::string& id)
49  : MSTrafficLightLogic(tlcontrol, id, "off", 0) {
51 }
52 
53 
55  for (MSTrafficLightLogic::Phases::const_iterator i = myPhaseDefinition.begin(); i != myPhaseDefinition.end(); ++i) {
56  delete *i;
57  }
58 }
59 
60 
61 void
63  rebuildPhase();
64 }
65 
66 
67 // ----------- Handling of controlled links
68 void
71  rebuildPhase();
72 }
73 
74 
75 void
77  size_t no = getLinks().size();
78  std::string state;
79  for (unsigned int i = 0; i < no; ++i) {
80  // !!! no brake mask!
81  state += 'o';
82  }
83  for (MSTrafficLightLogic::Phases::const_iterator i = myPhaseDefinition.begin(); i != myPhaseDefinition.end(); ++i) {
84  delete *i;
85  }
86  myPhaseDefinition.clear();
87  myPhaseDefinition.push_back(new MSPhaseDefinition(TIME2STEPS(120), state));
88 }
89 
90 
91 // ------------ Static Information Retrieval
92 unsigned int
94  return 0;
95 }
96 
97 
100  return myPhaseDefinition;
101 }
102 
103 
104 const MSPhaseDefinition&
105 MSOffTrafficLightLogic::getPhase(unsigned int) const {
106  return *myPhaseDefinition[0];
107 }
108 
109 
110 // ------------ Dynamic Information Retrieval
111 unsigned int
113  return 0;
114 }
115 
116 
117 const MSPhaseDefinition&
119  return *myPhaseDefinition[0];
120 }
121 
122 
123 // ------------ Conversion between time and phase
124 SUMOTime
126  return 0;
127 }
128 
129 
130 SUMOTime
132  return 0;
133 }
134 
135 
136 unsigned int
138  return 0;
139 }
140 
141 
142 
143 /****************************************************************************/
144