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 <cassert>
32 #include <utility>
33 #include <vector>
34 #include <bitset>
35 #include <sstream>
37 #include "MSTrafficLightLogic.h"
38 #include "MSOffTrafficLightLogic.h"
39 
40 #ifdef CHECK_MEMORY_LEAKS
41 #include <foreign/nvwa/debug_new.h>
42 #endif // CHECK_MEMORY_LEAKS
43 
44 
45 // ===========================================================================
46 // member method definitions
47 // ===========================================================================
49  const std::string& id)
50  : MSTrafficLightLogic(tlcontrol, id, "off", 0) {
52 }
53 
54 
56  for (MSTrafficLightLogic::Phases::const_iterator i = myPhaseDefinition.begin(); i != myPhaseDefinition.end(); ++i) {
57  delete *i;
58  }
59 }
60 
61 
62 void
64  rebuildPhase();
65 }
66 
67 
68 // ----------- Handling of controlled links
69 void
72  rebuildPhase();
73 }
74 
75 
76 void
78  size_t no = getLinks().size();
79  std::string state;
80  for (unsigned int i = 0; i < no; ++i) {
81  // !!! no brake mask!
82  state += 'o';
83  }
84  for (MSTrafficLightLogic::Phases::const_iterator i = myPhaseDefinition.begin(); i != myPhaseDefinition.end(); ++i) {
85  delete *i;
86  }
87  myPhaseDefinition.clear();
88  myPhaseDefinition.push_back(new MSPhaseDefinition(TIME2STEPS(120), state));
89 }
90 
91 
92 // ------------ Static Information Retrieval
93 unsigned int
95  return 0;
96 }
97 
98 
101  return myPhaseDefinition;
102 }
103 
104 
105 const MSPhaseDefinition&
106 MSOffTrafficLightLogic::getPhase(unsigned int) const {
107  return *myPhaseDefinition[0];
108 }
109 
110 
111 // ------------ Dynamic Information Retrieval
112 unsigned int
114  return 0;
115 }
116 
117 
118 const MSPhaseDefinition&
120  return *myPhaseDefinition[0];
121 }
122 
123 
124 // ------------ Conversion between time and phase
125 SUMOTime
127  return 0;
128 }
129 
130 
131 SUMOTime
133  return 0;
134 }
135 
136 
137 unsigned int
139  return 0;
140 }
141 
142 
143 
144 /****************************************************************************/
145