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-2017 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 
51 // ===========================================================================
52 // method definitions
53 // ===========================================================================
54 bool
56  tcpip::Storage& outputStorage) {
57  // variable & id
58  int variable = inputStorage.readUnsignedByte();
59  std::string id = inputStorage.readString();
60  // check variable
61  if (variable != ID_LIST && variable != VAR_EDGE_TRAVELTIME && variable != VAR_EDGE_EFFORT && variable != VAR_CURRENT_TRAVELTIME
62  && variable != VAR_CO2EMISSION && variable != VAR_COEMISSION && variable != VAR_HCEMISSION && variable != VAR_PMXEMISSION
63  && variable != VAR_NOXEMISSION && variable != VAR_FUELCONSUMPTION && variable != VAR_NOISEEMISSION
64  && variable != VAR_ELECTRICITYCONSUMPTION && variable != VAR_WAITING_TIME
65  && variable != LAST_STEP_VEHICLE_NUMBER && variable != LAST_STEP_MEAN_SPEED && variable != LAST_STEP_OCCUPANCY
66  && variable != LAST_STEP_VEHICLE_HALTING_NUMBER && variable != LAST_STEP_LENGTH
67  && variable != LAST_STEP_PERSON_ID_LIST
68  && variable != LAST_STEP_VEHICLE_ID_LIST && variable != ID_COUNT && variable != VAR_PARAMETER) {
69  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "Get Edge Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
70  }
71  // begin response building
72  tcpip::Storage tempMsg;
73  // response-code, variableID, objectID
75  tempMsg.writeUnsignedByte(variable);
76  tempMsg.writeString(id);
77  // process request
78  if (variable == ID_LIST) {
79  std::vector<std::string> ids;
80  MSEdge::insertIDs(ids);
82  tempMsg.writeStringList(ids);
83  } else if (variable == ID_COUNT) {
84  std::vector<std::string> ids;
85  MSEdge::insertIDs(ids);
87  tempMsg.writeInt((int) ids.size());
88  } else {
89  MSEdge* e = MSEdge::dictionary(id);
90  if (e == 0) {
91  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "Edge '" + id + "' is not known", outputStorage);
92  }
93  switch (variable) {
94  case VAR_EDGE_TRAVELTIME: {
95  // time
96  int time = 0;
97  if (!server.readTypeCheckingInt(inputStorage, time)) {
98  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The message must contain the time definition.", outputStorage);
99  }
101  double value;
102  if (!MSNet::getInstance()->getWeightsStorage().retrieveExistingTravelTime(e, time, value)) {
103  tempMsg.writeDouble(-1);
104  } else {
105  tempMsg.writeDouble(value);
106  }
107  }
108  break;
109  case VAR_EDGE_EFFORT: {
110  // time
111  int time = 0;
112  if (!server.readTypeCheckingInt(inputStorage, time)) {
113  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The message must contain the time definition.", outputStorage);
114  }
116  double value;
117  if (!MSNet::getInstance()->getWeightsStorage().retrieveExistingEffort(e, time, value)) {
118  tempMsg.writeDouble(-1);
119  } else {
120  tempMsg.writeDouble(value);
121  }
122  }
123  break;
126  tempMsg.writeDouble(e->getCurrentTravelTime());
127  break;
128  case VAR_WAITING_TIME: {
129  double wtime = 0;
130  const std::vector<MSLane*>& lanes = e->getLanes();
131  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
132  wtime += (*i)->getWaitingSeconds();
133  }
135  tempMsg.writeDouble(wtime);
136  }
137  break;
139  std::vector<std::string> personIDs;
140  std::vector<MSTransportable*> persons = e->getSortedPersons(MSNet::getInstance()->getCurrentTimeStep(), true);
141  for (std::vector<MSTransportable*>::iterator it = persons.begin(); it != persons.end(); ++it) {
142  personIDs.push_back((*it)->getID());
143  }
145  tempMsg.writeStringList(personIDs);
146  }
147  break;
149  std::vector<std::string> vehIDs;
150  const std::vector<MSLane*>& lanes = e->getLanes();
151  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
152  const MSLane::VehCont& vehs = (*i)->getVehiclesSecure();
153  for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
154  vehIDs.push_back((*j)->getID());
155  }
156  (*i)->releaseVehicles();
157  }
159  tempMsg.writeStringList(vehIDs);
160  }
161  break;
162  case VAR_CO2EMISSION: {
163  double sum = 0;
164  const std::vector<MSLane*>& lanes = e->getLanes();
165  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
166  sum += (*i)->getCO2Emissions();
167  }
169  tempMsg.writeDouble(sum);
170  }
171  break;
172  case VAR_COEMISSION: {
173  double sum = 0;
174  const std::vector<MSLane*>& lanes = e->getLanes();
175  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
176  sum += (*i)->getCOEmissions();
177  }
179  tempMsg.writeDouble(sum);
180  }
181  break;
182  case VAR_HCEMISSION: {
183  double sum = 0;
184  const std::vector<MSLane*>& lanes = e->getLanes();
185  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
186  sum += (*i)->getHCEmissions();
187  }
189  tempMsg.writeDouble(sum);
190  }
191  break;
192  case VAR_PMXEMISSION: {
193  double sum = 0;
194  const std::vector<MSLane*>& lanes = e->getLanes();
195  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
196  sum += (*i)->getPMxEmissions();
197  }
199  tempMsg.writeDouble(sum);
200  }
201  break;
202  case VAR_NOXEMISSION: {
203  double sum = 0;
204  const std::vector<MSLane*>& lanes = e->getLanes();
205  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
206  sum += (*i)->getNOxEmissions();
207  }
209  tempMsg.writeDouble(sum);
210  }
211  break;
212  case VAR_FUELCONSUMPTION: {
213  double sum = 0;
214  const std::vector<MSLane*>& lanes = e->getLanes();
215  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
216  sum += (*i)->getFuelConsumption();
217  }
219  tempMsg.writeDouble(sum);
220  }
221  break;
222  case VAR_NOISEEMISSION: {
223  double sum = 0;
224  const std::vector<MSLane*>& lanes = e->getLanes();
225  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
226  sum += (double) pow(10., ((*i)->getHarmonoise_NoiseEmissions() / 10.));
227  }
229  if (sum != 0) {
230  tempMsg.writeDouble(HelpersHarmonoise::sum(sum));
231  } else {
232  tempMsg.writeDouble(0);
233  }
234  }
235  break;
237  double sum = 0;
238  const std::vector<MSLane*>& lanes = e->getLanes();
239  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
240  sum += (*i)->getElectricityConsumption();
241  }
243  tempMsg.writeDouble(sum);
244  }
245  break;
247  int sum = 0;
248  const std::vector<MSLane*>& lanes = e->getLanes();
249  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
250  sum += (*i)->getVehicleNumber();
251  }
253  tempMsg.writeInt(sum);
254  }
255  break;
256  case LAST_STEP_MEAN_SPEED: {
258  tempMsg.writeDouble(e->getMeanSpeed());
259  }
260  break;
261  case LAST_STEP_OCCUPANCY: {
262  double sum = 0;
263  const std::vector<MSLane*>& lanes = e->getLanes();
264  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
265  sum += (*i)->getNettoOccupancy();
266  }
268  tempMsg.writeDouble(sum / (double) lanes.size());
269  }
270  break;
272  int halting = 0;
273  const std::vector<MSLane*>& lanes = e->getLanes();
274  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
275  const MSLane::VehCont& vehs = (*i)->getVehiclesSecure();
276  for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
277  if ((*j)->getSpeed() < SUMO_const_haltingSpeed) {
278  ++halting;
279  }
280  }
281  (*i)->releaseVehicles();
282  }
284  tempMsg.writeInt(halting);
285  }
286  break;
287  case LAST_STEP_LENGTH: {
288  double lengthSum = 0;
289  int noVehicles = 0;
290  const std::vector<MSLane*>& lanes = e->getLanes();
291  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
292  const MSLane::VehCont& vehs = (*i)->getVehiclesSecure();
293  for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
294  lengthSum += (*j)->getVehicleType().getLength();
295  }
296  noVehicles += (int) vehs.size();
297  (*i)->releaseVehicles();
298  }
300  if (noVehicles == 0) {
301  tempMsg.writeDouble(0);
302  } else {
303  tempMsg.writeDouble(lengthSum / (double) noVehicles);
304  }
305  }
306  break;
307  case VAR_PARAMETER: {
308  std::string paramName = "";
309  if (!server.readTypeCheckingString(inputStorage, paramName)) {
310  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage);
311  }
313  tempMsg.writeString(e->getParameter(paramName, ""));
314  }
315  break;
316  default:
317  break;
318  }
319  }
320  server.writeStatusCmd(CMD_GET_EDGE_VARIABLE, RTYPE_OK, "", outputStorage);
321  server.writeResponseWithLength(outputStorage, tempMsg);
322  return true;
323 }
324 
325 
326 bool
328  tcpip::Storage& outputStorage) {
329  std::string warning = ""; // additional description for response
330  // variable
331  int variable = inputStorage.readUnsignedByte();
332  if (variable != VAR_EDGE_TRAVELTIME && variable != VAR_EDGE_EFFORT && variable != VAR_MAXSPEED && variable != VAR_PARAMETER) {
333  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "Change Edge State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
334  }
335  // id
336  std::string id = inputStorage.readString();
337  MSEdge* e = MSEdge::dictionary(id);
338  if (e == 0) {
339  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "Edge '" + id + "' is not known", outputStorage);
340  }
341  // process
342  switch (variable) {
343  case LANE_ALLOWED: {
344  // read and set allowed vehicle classes
345  std::vector<std::string> classes;
346  if (!server.readTypeCheckingStringList(inputStorage, classes)) {
347  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "Allowed vehicle classes must be given as a list of strings.", outputStorage);
348  }
349  SVCPermissions permissions = parseVehicleClasses(classes);
350  const std::vector<MSLane*>& lanes = e->getLanes();
351  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
352  (*i)->setPermissions(permissions, MSLane::CHANGE_PERMISSIONS_PERMANENT);
353  }
354  e->rebuildAllowedLanes();
355  }
356  break;
357  case LANE_DISALLOWED: {
358  // read and set disallowed vehicle classes
359  std::vector<std::string> classes;
360  if (!server.readTypeCheckingStringList(inputStorage, classes)) {
361  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "Not allowed vehicle classes must be given as a list of strings.", outputStorage);
362  }
363  SVCPermissions permissions = ~parseVehicleClasses(classes); // negation yields allowed
364  const std::vector<MSLane*>& lanes = e->getLanes();
365  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
366  (*i)->setPermissions(permissions, MSLane::CHANGE_PERMISSIONS_PERMANENT);
367  }
368  e->rebuildAllowedLanes();
369  }
370  break;
371  case VAR_EDGE_TRAVELTIME: {
372  // read and set travel time
373  if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) {
374  return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting travel time requires a compound object.", outputStorage);
375  }
376  int parameterCount = inputStorage.readInt();
377  if (parameterCount == 3) {
378  // bound by time
379  int begTime = 0, endTime = 0;
380  double value = 0;
381  if (!server.readTypeCheckingInt(inputStorage, begTime)) {
382  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The first variable must be the begin time given as int.", outputStorage);
383  }
384  if (!server.readTypeCheckingInt(inputStorage, endTime)) {
385  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The second variable must be the end time given as int.", outputStorage);
386  }
387  if (!server.readTypeCheckingDouble(inputStorage, value)) {
388  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The third variable must be the value given as double", outputStorage);
389  }
390  MSNet::getInstance()->getWeightsStorage().addTravelTime(e, begTime, endTime, value);
391  } else if (parameterCount == 1) {
392  // unbound
393  double value = 0;
394  if (!server.readTypeCheckingDouble(inputStorage, value)) {
395  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The variable must be the value given as double", outputStorage);
396  }
398  } else {
399  return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting travel time requires either begin time, end time, and value, or only value as parameter.", outputStorage);
400  }
401  }
402  break;
403  case VAR_EDGE_EFFORT: {
404  // read and set effort
405  if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) {
406  return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting effort requires a compound object.", outputStorage);
407  }
408  int parameterCount = inputStorage.readInt();
409  if (parameterCount == 3) {
410  // bound by time
411  int begTime = 0, endTime = 0;
412  double value = 0;
413  if (!server.readTypeCheckingInt(inputStorage, begTime)) {
414  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The first variable must be the begin time given as int.", outputStorage);
415  }
416  if (!server.readTypeCheckingInt(inputStorage, endTime)) {
417  return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The second variable must be the end time given as int.", outputStorage);
418  }
419  if (!server.readTypeCheckingDouble(inputStorage, value)) {
420  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The third variable must be the value given as double", outputStorage);
421  }
422  MSNet::getInstance()->getWeightsStorage().addEffort(e, begTime, endTime, value);
423  } else if (parameterCount == 1) {
424  // unbound
425  double value = 0;
426  if (!server.readTypeCheckingDouble(inputStorage, value)) {
427  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The variable must be the value given as double", outputStorage);
428  }
429  MSNet::getInstance()->getWeightsStorage().addEffort(e, 0., double(SUMOTime_MAX), value);
430  } else {
431  return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting effort requires either begin time, end time, and value, or only value as parameter.", outputStorage);
432  }
433  }
434  break;
435  case VAR_MAXSPEED: {
436  // read and set max. speed
437  double value = 0;
438  if (!server.readTypeCheckingDouble(inputStorage, value)) {
439  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The speed must be given as a double.", outputStorage);
440  }
441  const std::vector<MSLane*>& lanes = e->getLanes();
442  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
443  (*i)->setMaxSpeed(value);
444  }
445  }
446  break;
447  case VAR_PARAMETER: {
448  if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) {
449  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage);
450  }
451  //readt itemNo
452  inputStorage.readInt();
453  std::string name;
454  if (!server.readTypeCheckingString(inputStorage, name)) {
455  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The name of the parameter must be given as a string.", outputStorage);
456  }
457  std::string value;
458  if (!server.readTypeCheckingString(inputStorage, value)) {
459  return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The value of the parameter must be given as a string.", outputStorage);
460  }
461  e->addParameter(name, value);
462  }
463  break;
464  default:
465  break;
466  }
467  server.writeStatusCmd(CMD_SET_EDGE_VARIABLE, RTYPE_OK, warning, outputStorage);
468  return true;
469 }
470 
471 
472 bool
473 TraCIServerAPI_Edge::getShape(const std::string& id, PositionVector& shape) {
474  MSEdge* e = MSEdge::dictionary(id);
475  if (e == 0) {
476  return false;
477  }
478  const std::vector<MSLane*>& lanes = e->getLanes();
479  shape = lanes.front()->getShape();
480  if (lanes.size() > 1) {
481  copy(lanes.back()->getShape().begin(), lanes.back()->getShape().end(), back_inserter(shape));
482  }
483  return true;
484 }
485 
486 #endif
487 
488 
489 /****************************************************************************/
490 
#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:776
#define VAR_CO2EMISSION
#define TYPE_COMPOUND
#define VAR_CURRENT_TRAVELTIME
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
#define RTYPE_OK
#define VAR_WAITING_TIME
bool readTypeCheckingInt(tcpip::Storage &inputStorage, int &into)
Reads the value type and an int, verifying the type.
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:192
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:158
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
double getMeanSpeed() const
get the mean speed
Definition: MSEdge.cpp:684
#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:728
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
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge&#39;s persons sorted by pos.
Definition: MSEdge.cpp:854
#define VAR_NOISEEMISSION
#define VAR_FUELCONSUMPTION
virtual void writeInt(int)
#define TYPE_STRING
virtual int readUnsignedByte()
#define LAST_STEP_LENGTH
#define VAR_NOXEMISSION
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
Definition: MSEdge.cpp:711
A road/street connecting two junctions.
Definition: MSEdge.h:80
#define LANE_ALLOWED
void rebuildAllowedLanes()
Definition: MSEdge.cpp:243
virtual int readInt()
#define SUMOTime_MAX
Definition: TraCIDefs.h:53
A list of positions.
void addTravelTime(const MSEdge *const e, double begin, double end, double value)
Adds a travel time information for an edge and a time span.
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:74
std::vector< MSVehicle * > VehCont
Container for vehicles.
Definition: MSLane.h:91
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.
const std::string & getParameter(const std::string &key, const std::string &defaultValue) const
Returns the value for a given key.
#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 TYPE_DOUBLE
std::string toHex(const T i, std::streamsize numDigits=0)
Definition: ToString.h:66
#define VAR_ELECTRICITYCONSUMPTION
virtual void writeDouble(double)
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
Definition: StdDefs.h:56
#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
static const long CHANGE_PERMISSIONS_PERMANENT
Definition: MSLane.h:1019
#define TYPE_INTEGER
#define ID_LIST
static double sum(double val)
Computes the resulting noise.
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xaa: Get Edge Variable)
#define LAST_STEP_VEHICLE_HALTING_NUMBER
#define VAR_HCEMISSION
#define RESPONSE_GET_EDGE_VARIABLE
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net&#39;s internal edge travel times/efforts container.
Definition: MSNet.cpp:747
void addEffort(const MSEdge *const e, double begin, double end, double value)
Adds an effort information for an edge and a time span.