Eclipse SUMO - Simulation of Urban MObility
TraCIServerAPI_TrafficLight.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2009-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // APIs for getting/setting traffic light values via TraCI
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <microsim/MSLane.h>
27 #include <microsim/MSEdge.h>
30 #include <libsumo/TraCIConstants.h>
31 #include <libsumo/TrafficLight.h>
33 
34 
35 // ===========================================================================
36 // method definitions
37 // ===========================================================================
38 bool
40  tcpip::Storage& outputStorage) {
41  const int variable = inputStorage.readUnsignedByte();
42  const std::string id = inputStorage.readString();
43  server.initWrapper(libsumo::RESPONSE_GET_TL_VARIABLE, variable, id);
44  try {
45  if (!libsumo::TrafficLight::handleVariable(id, variable, &server)) {
46  switch (variable) {
48  std::vector<libsumo::TraCILogic> logics = libsumo::TrafficLight::getCompleteRedYellowGreenDefinition(id);
49  tcpip::Storage& storage = server.getWrapperStorage();
51  storage.writeInt((int)logics.size());
52  for (const libsumo::TraCILogic& logic : logics) {
54  storage.writeInt(5);
56  storage.writeString(logic.programID);
57  // type
59  storage.writeInt(logic.type);
60  // (current) phase index
62  storage.writeInt(logic.currentPhaseIndex);
63  // phase number
65  storage.writeInt((int)logic.phases.size());
66  for (const libsumo::TraCIPhase& phase : logic.phases) {
68  storage.writeInt(6);
70  storage.writeDouble(phase.duration);
72  storage.writeString(phase.state);
74  storage.writeDouble(phase.minDur);
76  storage.writeDouble(phase.maxDur);
78  storage.writeInt((int)phase.next.size());
79  for (int n : phase.next) {
81  storage.writeInt(n);
82  }
84  storage.writeString(phase.name);
85  }
86  // subparameter
88  storage.writeInt((int)logic.subParameter.size());
89  for (const auto& item : logic.subParameter) {
91  storage.writeInt(2);
92  storage.writeString(item.first);
93  storage.writeString(item.second);
94  }
95  }
96  break;
97  }
99  const std::vector<std::vector<libsumo::TraCILink> > links = libsumo::TrafficLight::getControlledLinks(id);
101  tcpip::Storage tempContent;
102  int cnt = 0;
104  tempContent.writeInt((int)links.size());
105  for (const std::vector<libsumo::TraCILink>& sublinks : links) {
107  tempContent.writeInt((int)sublinks.size());
108  ++cnt;
109  for (const libsumo::TraCILink& link : sublinks) {
111  tempContent.writeStringList(std::vector<std::string>({ link.fromLane, link.toLane, link.viaLane }));
112  ++cnt;
113  }
114  }
115  server.getWrapperStorage().writeInt(cnt);
116  server.getWrapperStorage().writeStorage(tempContent);
117  break;
118  }
120  int index = 0;
121  if (!server.readTypeCheckingInt(inputStorage, index)) {
122  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "The phase index must be given as an integer.", outputStorage);
123  }
126  break;
127  }
128  case libsumo::VAR_PARAMETER: {
129  std::string paramName = "";
130  if (!server.readTypeCheckingString(inputStorage, paramName)) {
131  return server.writeErrorStatusCmd(libsumo::CMD_GET_TL_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage);
132  }
135  break;
136  }
138  if (!MSNet::getInstance()->getTLSControl().knows(id)) {
139  throw libsumo::TraCIException("Traffic light '" + id + "' is not known");
140  }
142  const std::string& state = tls->getCurrentPhaseDef().getState();
143  const std::map<std::string, std::string>& params = tls->getParametersMap();
144  int num = 0;
145  for (std::map<std::string, std::string>::const_iterator i = params.begin(); i != params.end(); ++i) {
146  if ("connection:" == (*i).first.substr(0, 11)) {
147  ++num;
148  }
149  }
150 
153  server.getWrapperStorage().writeInt(num * 2);
154  for (std::map<std::string, std::string>::const_iterator i = params.begin(); i != params.end(); ++i) {
155  if ("connection:" != (*i).first.substr(0, 11)) {
156  continue;
157  }
159  server.getWrapperStorage().writeString((*i).second); // foreign id
160  std::string connection = (*i).first.substr(11);
161  std::string from, to;
162  const std::string::size_type b = connection.find("->");
163  if (b == std::string::npos) {
164  from = connection;
165  } else {
166  from = connection.substr(0, b);
167  to = connection.substr(b + 2);
168  }
169  bool denotesEdge = from.find("_") == std::string::npos;
170  MSLane* fromLane = nullptr;
172  MSTrafficLightLogic::LaneVectorVector::const_iterator j = lanes.begin();
173  for (; j != lanes.end() && fromLane == nullptr;) {
174  for (MSTrafficLightLogic::LaneVector::const_iterator k = (*j).begin(); k != (*j).end() && fromLane == nullptr;) {
175  if (denotesEdge && (*k)->getEdge().getID() == from) {
176  fromLane = *k;
177  } else if (!denotesEdge && (*k)->getID() == from) {
178  fromLane = *k;
179  }
180  if (fromLane == nullptr) {
181  ++k;
182  }
183  }
184  if (fromLane == nullptr) {
185  ++j;
186  }
187  }
188  if (fromLane == nullptr) {
189  return server.writeErrorStatusCmd(libsumo::CMD_GET_TL_VARIABLE, "Could not find edge or lane '" + from + "' in traffic light '" + id + "'.", outputStorage);
190  }
191  int pos = (int)std::distance(lanes.begin(), j);
193  server.getWrapperStorage().writeUnsignedByte(state[pos]); // state
194  }
195  break;
196  }
197  default:
198  return server.writeErrorStatusCmd(libsumo::CMD_GET_TL_VARIABLE, "Get TLS Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
199  }
200  }
201  } catch (libsumo::TraCIException& e) {
202  return server.writeErrorStatusCmd(libsumo::CMD_GET_TL_VARIABLE, e.what(), outputStorage);
203  }
205  server.writeResponseWithLength(outputStorage, server.getWrapperStorage());
206  return true;
207 }
208 
209 
210 bool
212  tcpip::Storage& outputStorage) {
213  std::string warning = ""; // additional description for response
214  // variable
215  const int variable = inputStorage.readUnsignedByte();
216  if (variable != libsumo::TL_PHASE_INDEX && variable != libsumo::TL_PROGRAM && variable != libsumo::TL_PHASE_DURATION
218  && variable != libsumo::VAR_NAME
219  && variable != libsumo::VAR_PARAMETER) {
220  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "Change TLS State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
221  }
222  const std::string id = inputStorage.readString();
223  try {
224  switch (variable) {
226  int index = 0;
227  if (!server.readTypeCheckingInt(inputStorage, index)) {
228  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "The phase index must be given as an integer.", outputStorage);
229  }
231  }
232  break;
233  case libsumo::VAR_NAME: {
234  std::string name;
235  if (!server.readTypeCheckingString(inputStorage, name)) {
236  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "The phase name must be given as a string.", outputStorage);
237  }
239  }
240  break;
241  case libsumo::TL_PROGRAM: {
242  std::string subID;
243  if (!server.readTypeCheckingString(inputStorage, subID)) {
244  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "The program must be given as a string.", outputStorage);
245  }
247  }
248  break;
250  double duration = 0.;
251  if (!server.readTypeCheckingDouble(inputStorage, duration)) {
252  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "The phase duration must be given as a double.", outputStorage);
253  }
255  }
256  break;
258  std::string state;
259  if (!server.readTypeCheckingString(inputStorage, state)) {
260  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "The phase must be given as a string.", outputStorage);
261  }
263  }
264  break;
266  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
267  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "A compound object is needed for setting a new program.", outputStorage);
268  }
269  //read itemNo
270  inputStorage.readInt();
271  libsumo::TraCILogic logic;
272  if (!server.readTypeCheckingString(inputStorage, logic.programID)) {
273  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 1. parameter (programID) must be a string.", outputStorage);
274  }
275  if (!server.readTypeCheckingInt(inputStorage, logic.type)) {
276  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 2. parameter (type) must be an int.", outputStorage);
277  }
278  if (!server.readTypeCheckingInt(inputStorage, logic.currentPhaseIndex)) {
279  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 3. parameter (index) must be an int.", outputStorage);
280  }
281  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
282  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "A compound object is needed for the phases.", outputStorage);
283  }
284  const int numPhases = inputStorage.readInt();
285  for (int j = 0; j < numPhases; ++j) {
286  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
287  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "A compound object is needed for every phase.", outputStorage);
288  }
289  const int items = inputStorage.readInt();
290  if (items != 6 && items != 5) {
291  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "A phase compound object requires 5 or 6 items.", outputStorage);
292  }
293  double duration = 0., minDuration = 0., maxDuration = 0.;
294  std::vector<int> next;
295  std::string name;
296  if (!server.readTypeCheckingDouble(inputStorage, duration)) {
297  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 4.1. parameter (duration) must be a double.", outputStorage);
298  }
299  std::string state;
300  if (!server.readTypeCheckingString(inputStorage, state)) {
301  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 4.2. parameter (phase) must be a string.", outputStorage);
302  }
303  if (!server.readTypeCheckingDouble(inputStorage, minDuration)) {
304  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 4.3. parameter (min duration) must be a double.", outputStorage);
305  }
306  if (!server.readTypeCheckingDouble(inputStorage, maxDuration)) {
307  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 4.4. parameter (max duration) must be a double.", outputStorage);
308  }
309  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
310  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program 4.5 parameter (next) must be a compound (list of ints).", outputStorage);
311  }
312  const int numNext = inputStorage.readInt();
313  for (int k = 0; k < numNext; k++) {
314  int nextEntry;
315  if (!server.readTypeCheckingInt(inputStorage, nextEntry)) {
316  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 4.5. parameter (next) must be a list of int.", outputStorage);
317  }
318  next.push_back(nextEntry);
319  }
320  if (items == 6) {
321  if (!server.readTypeCheckingString(inputStorage, name)) {
322  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 4.6. parameter (name) must be a string.", outputStorage);
323  }
324  }
325  logic.phases.emplace_back(libsumo::TraCIPhase(duration, state, minDuration, maxDuration, next, name));
326  }
327  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
328  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 5. parameter (subparams) must be a compound object.", outputStorage);
329  }
330  const int numParams = inputStorage.readInt();
331  for (int j = 0; j < numParams; j++) {
332  std::vector<std::string> par;
333  server.readTypeCheckingStringList(inputStorage, par);
334  logic.subParameter[par[0]] = par[1];
335  }
337  }
338  break;
339  case libsumo::VAR_PARAMETER: {
340  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
341  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage);
342  }
343  //read itemNo
344  inputStorage.readInt();
345  std::string name;
346  if (!server.readTypeCheckingString(inputStorage, name)) {
347  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "The name of the parameter must be given as a string.", outputStorage);
348  }
349  std::string value;
350  if (!server.readTypeCheckingString(inputStorage, value)) {
351  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "The value of the parameter must be given as a string.", outputStorage);
352  }
353  libsumo::TrafficLight::setParameter(id, name, value);
354  }
355  break;
356  default:
357  break;
358  }
359  } catch (libsumo::TraCIException& e) {
360  return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, e.what(), outputStorage);
361  }
362  server.writeStatusCmd(libsumo::CMD_SET_TL_VARIABLE, libsumo::RTYPE_OK, warning, outputStorage);
363  return true;
364 }
365 
366 
367 /****************************************************************************/
libsumo::CMD_GET_TL_VARIABLE
TRACI_CONST int CMD_GET_TL_VARIABLE
Definition: TraCIConstants.h:119
libsumo::RTYPE_OK
TRACI_CONST int RTYPE_OK
Definition: TraCIConstants.h:352
libsumo::TL_PHASE_INDEX
TRACI_CONST int TL_PHASE_INDEX
Definition: TraCIConstants.h:552
TraCIServerAPI_TrafficLight.h
libsumo::TrafficLight::getControlledLinks
static std::vector< std::vector< TraCILink > > getControlledLinks(const std::string &tlsID)
Definition: TrafficLight.cpp:114
libsumo::TrafficLight::setParameter
static void setParameter(const std::string &tlsID, const std::string &paramName, const std::string &value)
Definition: TrafficLight.cpp:305
libsumo::TrafficLight::setProgram
static void setProgram(const std::string &tlsID, const std::string &programID)
Definition: TrafficLight.cpp:237
MSTLLogicControl.h
libsumo::TL_CONTROLLED_LINKS
TRACI_CONST int TL_CONTROLLED_LINKS
Definition: TraCIConstants.h:564
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
libsumo::VAR_NAME
TRACI_CONST int VAR_NAME
Definition: TraCIConstants.h:546
libsumo::TL_PROGRAM
TRACI_CONST int TL_PROGRAM
Definition: TraCIConstants.h:555
libsumo::TraCILogic::type
int type
Definition: TraCIDefs.h:246
tcpip::Storage::writeUnsignedByte
virtual void writeUnsignedByte(int)
libsumo::TL_COMPLETE_PROGRAM_RYG
TRACI_CONST int TL_COMPLETE_PROGRAM_RYG
Definition: TraCIConstants.h:579
libsumo::TraCIPhase::maxDur
double maxDur
Definition: TraCIDefs.h:219
libsumo::TL_PHASE_DURATION
TRACI_CONST int TL_PHASE_DURATION
Definition: TraCIConstants.h:558
TraCIServer::readTypeCheckingString
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
Definition: TraCIServer.cpp:1414
TraCIServer::writeResponseWithLength
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
Definition: TraCIServer.cpp:1366
libsumo::VAR_PERSON_NUMBER
TRACI_CONST int VAR_PERSON_NUMBER
Definition: TraCIConstants.h:805
libsumo::TraCILogic::currentPhaseIndex
int currentPhaseIndex
Definition: TraCIDefs.h:247
libsumo::VAR_PARAMETER
TRACI_CONST int VAR_PARAMETER
Definition: TraCIConstants.h:939
MSEdge.h
libsumo::TL_EXTERNAL_STATE
TRACI_CONST int TL_EXTERNAL_STATE
Definition: TraCIConstants.h:585
libsumo::TrafficLight::setPhase
static void setPhase(const std::string &tlsID, const int index)
Definition: TrafficLight.cpp:218
TraCIServer::getWrapperStorage
tcpip::Storage & getWrapperStorage()
Definition: TraCIServer.cpp:174
MSTLLogicControl::TLSLogicVariants::getActive
MSTrafficLightLogic * getActive() const
Definition: MSTLLogicControl.cpp:200
MSSimpleTrafficLightLogic.h
libsumo::TrafficLight::setCompleteRedYellowGreenDefinition
static void setCompleteRedYellowGreenDefinition(const std::string &tlsID, const TraCILogic &logic)
Definition: TrafficLight.cpp:256
TraCIServer::readTypeCheckingDouble
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
Definition: TraCIServer.cpp:1404
TraCIServer::writeStatusCmd
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
Definition: TraCIServer.cpp:968
libsumo::TrafficLight::setRedYellowGreenState
static void setRedYellowGreenState(const std::string &tlsID, const std::string &state)
Definition: TrafficLight.cpp:212
TraCIServer::initWrapper
void initWrapper(const int domainID, const int variable, const std::string &objID)
Definition: TraCIServer.cpp:102
libsumo::TraCILogic
Definition: TraCIDefs.h:232
Parameterised::getParametersMap
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
Definition: Parameterised.cpp:106
tcpip::Storage::readUnsignedByte
virtual int readUnsignedByte()
tcpip::Storage::writeInt
virtual void writeInt(int)
libsumo::TYPE_DOUBLE
TRACI_CONST int TYPE_DOUBLE
Definition: TraCIConstants.h:335
MSTLLogicControl::get
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
Definition: MSTLLogicControl.cpp:589
tcpip::Storage::readString
virtual std::string readString()
TraCIConstants.h
tcpip::Storage::readInt
virtual int readInt()
libsumo::TYPE_INTEGER
TRACI_CONST int TYPE_INTEGER
Definition: TraCIConstants.h:333
MSPhaseDefinition::getState
const std::string & getState() const
Returns the state within this phase.
Definition: MSPhaseDefinition.h:199
tcpip::Storage::writeStorage
virtual void writeStorage(tcpip::Storage &store)
libsumo::TraCILogic::programID
std::string programID
Definition: TraCIDefs.h:245
tcpip::Storage::writeStringList
virtual void writeStringList(const std::vector< std::string > &s)
libsumo::TraCIPhase::state
std::string state
Definition: TraCIDefs.h:218
toHex
std::string toHex(const T i, std::streamsize numDigits=0)
Definition: ToString.h:57
libsumo::CMD_SET_TL_VARIABLE
TRACI_CONST int CMD_SET_TL_VARIABLE
Definition: TraCIConstants.h:123
libsumo::TrafficLight::setPhaseDuration
static void setPhaseDuration(const std::string &tlsID, const double phaseDuration)
Definition: TrafficLight.cpp:247
MSTrafficLightLogic
The parent class for traffic light logics.
Definition: MSTrafficLightLogic.h:55
libsumo::TraCIPhase::minDur
double minDur
Definition: TraCIDefs.h:219
TrafficLight.h
libsumo::TraCIPhase::duration
double duration
Definition: TraCIDefs.h:217
libsumo::TrafficLight::setPhaseName
static void setPhaseName(const std::string &tlsID, const std::string &name)
Definition: TrafficLight.cpp:230
TraCIServer::readTypeCheckingStringList
bool readTypeCheckingStringList(tcpip::Storage &inputStorage, std::vector< std::string > &into)
Reads the value type and a string list, verifying the type.
Definition: TraCIServer.cpp:1424
libsumo::TraCIPhase::next
std::vector< int > next
Definition: TraCIDefs.h:220
libsumo::TraCIException
Definition: TraCIDefs.h:89
libsumo::TrafficLight::getParameter
static std::string getParameter(const std::string &tlsID, const std::string &paramName)
Definition: TrafficLight.cpp:206
libsumo::TYPE_STRINGLIST
TRACI_CONST int TYPE_STRINGLIST
Definition: TraCIConstants.h:339
MSTrafficLightLogic::getLaneVectors
const LaneVectorVector & getLaneVectors() const
Returns the list of lists of all lanes controlled by this tls.
Definition: MSTrafficLightLogic.h:182
tcpip::Storage::writeString
virtual void writeString(const std::string &s)
MSNet::getTLSControl
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
Definition: MSNet.h:409
libsumo::TraCILogic::phases
std::vector< TraCIPhase > phases
Definition: TraCIDefs.h:248
libsumo::TraCIPhase
Definition: TraCIDefs.h:207
TraCIServer::readTypeCheckingInt
bool readTypeCheckingInt(tcpip::Storage &inputStorage, int &into)
Reads the value type and an int, verifying the type.
Definition: TraCIServer.cpp:1394
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
libsumo::TrafficLight::handleVariable
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
Definition: TrafficLight.cpp:329
TraCIServerAPI_TrafficLight::processGet
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xa2: Get Traffic Lights Variable)
Definition: TraCIServerAPI_TrafficLight.cpp:39
libsumo::TrafficLight::getServedPersonCount
static int getServedPersonCount(const std::string &tlsID, int index)
Definition: TrafficLight.cpp:166
libsumo::TYPE_STRING
TRACI_CONST int TYPE_STRING
Definition: TraCIConstants.h:337
libsumo::TL_RED_YELLOW_GREEN_STATE
TRACI_CONST int TL_RED_YELLOW_GREEN_STATE
Definition: TraCIConstants.h:549
libsumo::TYPE_UBYTE
TRACI_CONST int TYPE_UBYTE
Definition: TraCIConstants.h:329
MSTrafficLightLogic::LaneVectorVector
std::vector< LaneVector > LaneVectorVector
Definition of a list that holds lists of lanes that do have the same attribute.
Definition: MSTrafficLightLogic.h:73
libsumo::RESPONSE_GET_TL_VARIABLE
TRACI_CONST int RESPONSE_GET_TL_VARIABLE
Definition: TraCIConstants.h:121
libsumo::TraCILogic::subParameter
std::map< std::string, std::string > subParameter
Definition: TraCIDefs.h:249
config.h
tcpip::Storage::writeDouble
virtual void writeDouble(double)
TraCIServerAPI_TrafficLight::processSet
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xc2: Change Traffic Lights State)
Definition: TraCIServerAPI_TrafficLight.cpp:211
TraCIServer
TraCI server used to control sumo by a remote TraCI client.
Definition: TraCIServer.h:61
libsumo::TraCIPhase::name
std::string name
Definition: TraCIDefs.h:221
MSLane.h
libsumo::TL_COMPLETE_DEFINITION_RYG
TRACI_CONST int TL_COMPLETE_DEFINITION_RYG
Definition: TraCIConstants.h:576
tcpip::Storage
Definition: storage.h:36
libsumo::TrafficLight::getCompleteRedYellowGreenDefinition
static std::vector< TraCILogic > getCompleteRedYellowGreenDefinition(const std::string &tlsID)
Definition: TrafficLight.cpp:70
MSTrafficLightLogic::getCurrentPhaseDef
virtual const MSPhaseDefinition & getCurrentPhaseDef() const =0
Returns the definition of the current phase.
libsumo::TYPE_COMPOUND
TRACI_CONST int TYPE_COMPOUND
Definition: TraCIConstants.h:341
TraCIServer::writeErrorStatusCmd
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
Definition: TraCIServer.cpp:982