SUMO - Simulation of Urban MObility
TraCIServerAPI_Edge.cpp
Go to the documentation of this file.
1 /****************************************************************************/
12 // APIs for getting/setting edge values via TraCI
13 /****************************************************************************/
14 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
15 // Copyright (C) 2002-2016 DLR (http://www.dlr.de/) and contributors
16 /****************************************************************************/
17 //
18 // This file is part of SUMO.
19 // SUMO is free software: you can redistribute it and/or modify
20 // it under the terms of the GNU General Public License as published by
21 // the Free Software Foundation, either version 3 of the License, or
22 // (at your option) any later version.
23 //
24 /****************************************************************************/
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #ifndef NO_TRACI
37 
38 #include <utils/common/StdDefs.h>
39 #include <microsim/MSNet.h>
40 #include <microsim/MSEdgeControl.h>
41 #include <microsim/MSEdge.h>
42 #include <microsim/MSLane.h>
43 #include <microsim/MSVehicle.h>
45 #include "TraCIConstants.h"
46 #include "TraCIServerAPI_Edge.h"
49 
50 #ifdef CHECK_MEMORY_LEAKS
51 #include <foreign/nvwa/debug_new.h>
52 #endif // CHECK_MEMORY_LEAKS
53 
54 
55 // ===========================================================================
56 // method definitions
57 // ===========================================================================
58 bool
60  tcpip::Storage& outputStorage) {
61  // variable & id
62  int variable = inputStorage.readUnsignedByte();
63  std::string id = inputStorage.readString();
64  // check variable
65  if (variable != ID_LIST && variable != VAR_EDGE_TRAVELTIME && variable != VAR_EDGE_EFFORT && variable != VAR_CURRENT_TRAVELTIME
66  && variable != VAR_CO2EMISSION && variable != VAR_COEMISSION && variable != VAR_HCEMISSION && variable != VAR_PMXEMISSION
67  && variable != VAR_NOXEMISSION && variable != VAR_FUELCONSUMPTION && variable != VAR_NOISEEMISSION && variable != VAR_WAITING_TIME
68  && variable != LAST_STEP_VEHICLE_NUMBER && variable != LAST_STEP_MEAN_SPEED && variable != LAST_STEP_OCCUPANCY
69  && variable != LAST_STEP_VEHICLE_HALTING_NUMBER && variable != LAST_STEP_LENGTH
70  && variable != LAST_STEP_PERSON_ID_LIST
71  && variable != LAST_STEP_VEHICLE_ID_LIST && variable != ID_COUNT && variable != VAR_PARAMETER) {
72  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "Get Edge Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
73  }
74  // begin response building
75  tcpip::Storage tempMsg;
76  // response-code, variableID, objectID
78  tempMsg.writeUnsignedByte(variable);
79  tempMsg.writeString(id);
80  // process request
81  if (variable == ID_LIST) {
82  std::vector<std::string> ids;
83  MSEdge::insertIDs(ids);
85  tempMsg.writeStringList(ids);
86  } else if (variable == ID_COUNT) {
87  std::vector<std::string> ids;
88  MSEdge::insertIDs(ids);
90  tempMsg.writeInt((int) ids.size());
91  } else {
92  MSEdge* e = MSEdge::dictionary(id);
93  if (e == 0) {
94  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "Edge '" + id + "' is not known", outputStorage);
95  }
96  switch (variable) {
97  case VAR_EDGE_TRAVELTIME: {
98  // time
99  int time = 0;
100  if (!server.readTypeCheckingInt(inputStorage, time)) {
101  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The message must contain the time definition.", outputStorage);
102  }
104  SUMOReal value;
105  if (!MSNet::getInstance()->getWeightsStorage().retrieveExistingTravelTime(e, time, value)) {
106  tempMsg.writeDouble(-1);
107  } else {
108  tempMsg.writeDouble(value);
109  }
110  }
111  break;
112  case VAR_EDGE_EFFORT: {
113  // time
114  int time = 0;
115  if (!server.readTypeCheckingInt(inputStorage, time)) {
116  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The message must contain the time definition.", outputStorage);
117  }
119  SUMOReal value;
120  if (!MSNet::getInstance()->getWeightsStorage().retrieveExistingEffort(e, time, value)) {
121  tempMsg.writeDouble(-1);
122  } else {
123  tempMsg.writeDouble(value);
124  }
125  }
126  break;
129  tempMsg.writeDouble(e->getCurrentTravelTime());
130  break;
131  case VAR_WAITING_TIME: {
132  SUMOReal wtime = 0;
133  const std::vector<MSLane*>& lanes = e->getLanes();
134  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
135  wtime += (*i)->getWaitingSeconds();
136  }
138  tempMsg.writeDouble(wtime);
139  }
140  break;
142  std::vector<std::string> personIDs;
143  std::vector<MSTransportable*> persons = e->getSortedPersons(MSNet::getInstance()->getCurrentTimeStep());
144  for (std::vector<MSTransportable*>::iterator it = persons.begin(); it != persons.end(); ++it) {
145  personIDs.push_back((*it)->getID());
146  }
148  tempMsg.writeStringList(personIDs);
149  }
150  break;
152  std::vector<std::string> vehIDs;
153  const std::vector<MSLane*>& lanes = e->getLanes();
154  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
155  const MSLane::VehCont& vehs = (*i)->getVehiclesSecure();
156  for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
157  vehIDs.push_back((*j)->getID());
158  }
159  (*i)->releaseVehicles();
160  }
162  tempMsg.writeStringList(vehIDs);
163  }
164  break;
165  case VAR_CO2EMISSION: {
166  SUMOReal sum = 0;
167  const std::vector<MSLane*>& lanes = e->getLanes();
168  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
169  sum += (*i)->getCO2Emissions();
170  }
172  tempMsg.writeDouble(sum);
173  }
174  break;
175  case VAR_COEMISSION: {
176  SUMOReal sum = 0;
177  const std::vector<MSLane*>& lanes = e->getLanes();
178  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
179  sum += (*i)->getCOEmissions();
180  }
182  tempMsg.writeDouble(sum);
183  }
184  break;
185  case VAR_HCEMISSION: {
186  SUMOReal sum = 0;
187  const std::vector<MSLane*>& lanes = e->getLanes();
188  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
189  sum += (*i)->getHCEmissions();
190  }
192  tempMsg.writeDouble(sum);
193  }
194  break;
195  case VAR_PMXEMISSION: {
196  SUMOReal sum = 0;
197  const std::vector<MSLane*>& lanes = e->getLanes();
198  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
199  sum += (*i)->getPMxEmissions();
200  }
202  tempMsg.writeDouble(sum);
203  }
204  break;
205  case VAR_NOXEMISSION: {
206  SUMOReal sum = 0;
207  const std::vector<MSLane*>& lanes = e->getLanes();
208  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
209  sum += (*i)->getNOxEmissions();
210  }
212  tempMsg.writeDouble(sum);
213  }
214  break;
215  case VAR_FUELCONSUMPTION: {
216  SUMOReal sum = 0;
217  const std::vector<MSLane*>& lanes = e->getLanes();
218  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
219  sum += (*i)->getFuelConsumption();
220  }
222  tempMsg.writeDouble(sum);
223  }
224  break;
225  case VAR_NOISEEMISSION: {
226  SUMOReal sum = 0;
227  const std::vector<MSLane*>& lanes = e->getLanes();
228  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
229  sum += (SUMOReal) pow(10., ((*i)->getHarmonoise_NoiseEmissions() / 10.));
230  }
232  if (sum != 0) {
233  tempMsg.writeDouble(HelpersHarmonoise::sum(sum));
234  } else {
235  tempMsg.writeDouble(0);
236  }
237  }
238  break;
240  int sum = 0;
241  const std::vector<MSLane*>& lanes = e->getLanes();
242  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
243  sum += (*i)->getVehicleNumber();
244  }
246  tempMsg.writeInt(sum);
247  }
248  break;
249  case LAST_STEP_MEAN_SPEED: {
250  SUMOReal sum = 0;
251  const std::vector<MSLane*>& lanes = e->getLanes();
252  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
253  sum += (*i)->getMeanSpeed();
254  }
256  tempMsg.writeDouble(sum / (SUMOReal) lanes.size());
257  }
258  break;
259  case LAST_STEP_OCCUPANCY: {
260  SUMOReal sum = 0;
261  const std::vector<MSLane*>& lanes = e->getLanes();
262  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
263  sum += (*i)->getNettoOccupancy();
264  }
266  tempMsg.writeDouble(sum / (SUMOReal) lanes.size());
267  }
268  break;
270  int halting = 0;
271  const std::vector<MSLane*>& lanes = e->getLanes();
272  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
273  const MSLane::VehCont& vehs = (*i)->getVehiclesSecure();
274  for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
275  if ((*j)->getSpeed() < SUMO_const_haltingSpeed) {
276  ++halting;
277  }
278  }
279  (*i)->releaseVehicles();
280  }
282  tempMsg.writeInt(halting);
283  }
284  break;
285  case LAST_STEP_LENGTH: {
286  SUMOReal lengthSum = 0;
287  int noVehicles = 0;
288  const std::vector<MSLane*>& lanes = e->getLanes();
289  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
290  const MSLane::VehCont& vehs = (*i)->getVehiclesSecure();
291  for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
292  lengthSum += (*j)->getVehicleType().getLength();
293  }
294  noVehicles += (int) vehs.size();
295  (*i)->releaseVehicles();
296  }
298  if (noVehicles == 0) {
299  tempMsg.writeDouble(0);
300  } else {
301  tempMsg.writeDouble(lengthSum / (SUMOReal) noVehicles);
302  }
303  }
304  break;
305  case VAR_PARAMETER: {
306  std::string paramName = "";
307  if (!server.readTypeCheckingString(inputStorage, paramName)) {
308  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage);
309  }
311  tempMsg.writeString(e->getParameter(paramName, ""));
312  }
313  break;
314  default:
315  break;
316  }
317  }
318  server.writeStatusCmd(CMD_GET_EDGE_VARIABLE, RTYPE_OK, "", outputStorage);
319  server.writeResponseWithLength(outputStorage, tempMsg);
320  return true;
321 }
322 
323 
324 bool
326  tcpip::Storage& outputStorage) {
327  std::string warning = ""; // additional description for response
328  // variable
329  int variable = inputStorage.readUnsignedByte();
330  if (variable != VAR_EDGE_TRAVELTIME && variable != VAR_EDGE_EFFORT && variable != VAR_MAXSPEED && variable != VAR_PARAMETER) {
331  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "Change Edge State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
332  }
333  // id
334  std::string id = inputStorage.readString();
335  MSEdge* e = MSEdge::dictionary(id);
336  if (e == 0) {
337  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "Edge '" + id + "' is not known", outputStorage);
338  }
339  // process
340  switch (variable) {
341  case LANE_ALLOWED: {
342  // read and set allowed vehicle classes
343  std::vector<std::string> classes;
344  if (!server.readTypeCheckingStringList(inputStorage, classes)) {
345  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "Allowed vehicle classes must be given as a list of strings.", outputStorage);
346  }
347  SVCPermissions permissions = parseVehicleClasses(classes);
348  const std::vector<MSLane*>& lanes = e->getLanes();
349  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
350  (*i)->setPermissions(permissions);
351  }
352  e->rebuildAllowedLanes();
353  }
354  break;
355  case LANE_DISALLOWED: {
356  // read and set disallowed vehicle classes
357  std::vector<std::string> classes;
358  if (!server.readTypeCheckingStringList(inputStorage, classes)) {
359  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "Not allowed vehicle classes must be given as a list of strings.", outputStorage);
360  }
361  SVCPermissions permissions = ~parseVehicleClasses(classes); // negation yields allowed
362  const std::vector<MSLane*>& lanes = e->getLanes();
363  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
364  (*i)->setPermissions(permissions);
365  }
366  e->rebuildAllowedLanes();
367  }
368  break;
369  case VAR_EDGE_TRAVELTIME: {
370  // read and set travel time
371  if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) {
372  return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting travel time requires a compound object.", outputStorage);
373  }
374  int parameterCount = inputStorage.readInt();
375  if (parameterCount == 3) {
376  // bound by time
377  int begTime = 0, endTime = 0;
378  double value = 0;
379  if (!server.readTypeCheckingInt(inputStorage, begTime)) {
380  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The first variable must be the begin time given as int.", outputStorage);
381  }
382  if (!server.readTypeCheckingInt(inputStorage, endTime)) {
383  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The second variable must be the end time given as int.", outputStorage);
384  }
385  if (!server.readTypeCheckingDouble(inputStorage, value)) {
386  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The third variable must be the value given as double", outputStorage);
387  }
388  MSNet::getInstance()->getWeightsStorage().addTravelTime(e, begTime, endTime, value);
389  } else if (parameterCount == 1) {
390  // unbound
391  double value = 0;
392  if (!server.readTypeCheckingDouble(inputStorage, value)) {
393  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The variable must be the value given as double", outputStorage);
394  }
396  } else {
397  return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting travel time requires either begin time, end time, and value, or only value as parameter.", outputStorage);
398  }
399  }
400  break;
401  case VAR_EDGE_EFFORT: {
402  // read and set effort
403  if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) {
404  return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting effort requires a compound object.", outputStorage);
405  }
406  int parameterCount = inputStorage.readInt();
407  if (parameterCount == 3) {
408  // bound by time
409  int begTime = 0, endTime = 0;
410  double value = 0;
411  if (!server.readTypeCheckingInt(inputStorage, begTime)) {
412  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The first variable must be the begin time given as int.", outputStorage);
413  }
414  if (!server.readTypeCheckingInt(inputStorage, endTime)) {
415  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The second variable must be the end time given as int.", outputStorage);
416  }
417  if (!server.readTypeCheckingDouble(inputStorage, value)) {
418  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The third variable must be the value given as double", outputStorage);
419  }
420  MSNet::getInstance()->getWeightsStorage().addEffort(e, begTime, endTime, value);
421  } else if (parameterCount == 1) {
422  // unbound
423  double value = 0;
424  if (!server.readTypeCheckingDouble(inputStorage, value)) {
425  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The variable must be the value given as double", outputStorage);
426  }
428  } else {
429  return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting effort requires either begin time, end time, and value, or only value as parameter.", outputStorage);
430  }
431  }
432  break;
433  case VAR_MAXSPEED: {
434  // read and set max. speed
435  double value = 0;
436  if (!server.readTypeCheckingDouble(inputStorage, value)) {
437  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The speed must be given as a double.", outputStorage);
438  }
439  const std::vector<MSLane*>& lanes = e->getLanes();
440  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
441  (*i)->setMaxSpeed(value);
442  }
443  }
444  break;
445  case VAR_PARAMETER: {
446  if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) {
447  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage);
448  }
449  //readt itemNo
450  inputStorage.readInt();
451  std::string name;
452  if (!server.readTypeCheckingString(inputStorage, name)) {
453  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The name of the parameter must be given as a string.", outputStorage);
454  }
455  std::string value;
456  if (!server.readTypeCheckingString(inputStorage, value)) {
457  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The value of the parameter must be given as a string.", outputStorage);
458  }
459  e->addParameter(name, value);
460  }
461  break;
462  default:
463  break;
464  }
465  server.writeStatusCmd(CMD_SET_EDGE_VARIABLE, RTYPE_OK, warning, outputStorage);
466  return true;
467 }
468 
469 
470 bool
471 TraCIServerAPI_Edge::getShape(const std::string& id, PositionVector& shape) {
472  MSEdge* e = MSEdge::dictionary(id);
473  if (e == 0) {
474  return false;
475  }
476  const std::vector<MSLane*>& lanes = e->getLanes();
477  shape = lanes.front()->getShape();
478  if (lanes.size() > 1) {
479  copy(lanes.back()->getShape().begin(), lanes.back()->getShape().end(), back_inserter(shape));
480  }
481  return true;
482 }
483 
484 #endif
485 
486 
487 /****************************************************************************/
488 
#define LAST_STEP_MEAN_SPEED
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
Definition: MSEdge.cpp:626
#define VAR_CO2EMISSION
#define TYPE_COMPOUND
#define VAR_CURRENT_TRAVELTIME
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:185
int SVCPermissions
#define RTYPE_OK
#define VAR_WAITING_TIME
std::vector< MSVehicle * > VehCont
Container for vehicles.
Definition: MSLane.h:88
bool readTypeCheckingInt(tcpip::Storage &inputStorage, int &into)
Reads the value type and an int, verifying the type.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:160
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
#define TYPE_STRINGLIST
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn&#39;t already in the dictionary...
Definition: MSEdge.cpp:578
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xca: Change Edge State)
virtual void writeUnsignedByte(int)
#define CMD_SET_EDGE_VARIABLE
const std::string & getParameter(const std::string &key, const std::string &defaultValue) const
Returns the value for a given key.
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
#define VAR_NOISEEMISSION
#define VAR_FUELCONSUMPTION
void addEffort(const MSEdge *const e, SUMOReal begin, SUMOReal end, SUMOReal value)
Adds an effort information for an edge and a time span.
virtual void writeInt(int)
#define TYPE_STRING
virtual int readUnsignedByte()
#define LAST_STEP_LENGTH
void addTravelTime(const MSEdge *const e, SUMOReal begin, SUMOReal end, SUMOReal value)
Adds a travel time information for an edge and a time span.
#define VAR_NOXEMISSION
A road/street connecting two junctions.
Definition: MSEdge.h:80
#define LANE_ALLOWED
void rebuildAllowedLanes()
Definition: MSEdge.cpp:172
virtual int readInt()
A list of positions.
bool readTypeCheckingStringList(tcpip::Storage &inputStorage, std::vector< std::string > &into)
Reads the value type and a string list, verifying the type.
virtual void writeStringList(const std::vector< std::string > &s)
#define VAR_PMXEMISSION
#define CMD_SET_VEHICLE_VARIABLE
virtual std::string readString()
#define CMD_GET_EDGE_VARIABLE
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
#define VAR_EDGE_EFFORT
TraCI server used to control sumo by a remote TraCI client.
Definition: TraCIServer.h:73
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
#define LAST_STEP_VEHICLE_NUMBER
void addParameter(const std::string &key, const std::string &value)
Adds a parameter.
#define VAR_EDGE_TRAVELTIME
#define VAR_COEMISSION
static bool getShape(const std::string &id, PositionVector &shape)
Returns the named edge&#39;s shape.
virtual void writeString(const std::string &s)
#define LAST_STEP_VEHICLE_ID_LIST
#define LANE_DISALLOWED
#define SUMOTime_MAX
Definition: SUMOTime.h:44
#define TYPE_DOUBLE
std::string toHex(const T i, std::streamsize numDigits=0)
Definition: ToString.h:64
const SUMOReal SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
Definition: StdDefs.h:57
static SUMOReal sum(SUMOReal val)
Computes the resulting noise.
virtual void writeDouble(double)
#define SUMOReal
Definition: config.h:213
#define LAST_STEP_PERSON_ID_LIST
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
#define LAST_STEP_OCCUPANCY
#define VAR_MAXSPEED
#define VAR_PARAMETER
#define ID_COUNT
#define TYPE_INTEGER
#define ID_LIST
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xaa: Get Edge Variable)
SUMOReal getCurrentTravelTime(const SUMOReal minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
Definition: MSEdge.cpp:559
#define LAST_STEP_VEHICLE_HALTING_NUMBER
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep) const
Returns this edge&#39;s persons sorted by pos.
Definition: MSEdge.cpp:699
#define VAR_HCEMISSION
#define RESPONSE_GET_EDGE_VARIABLE
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net&#39;s internal edge travel times/efforts container.
Definition: MSNet.cpp:707