SUMO - Simulation of Urban MObility
TraCIServerAPI_Simulation.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // APIs for getting/setting edge values via TraCI
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #ifndef NO_TRACI
35 
36 #include <utils/common/StdDefs.h>
38 #include <microsim/MSNet.h>
39 #include <microsim/MSEdgeControl.h>
41 #include <microsim/MSEdge.h>
42 #include <microsim/MSLane.h>
43 #include <microsim/MSVehicle.h>
45 #include "TraCIConstants.h"
47 
48 #ifdef CHECK_MEMORY_LEAKS
49 #include <foreign/nvwa/debug_new.h>
50 #endif // CHECK_MEMORY_LEAKS
51 
52 
53 // ===========================================================================
54 // method definitions
55 // ===========================================================================
56 bool
58  tcpip::Storage& outputStorage) {
59  // variable & id
60  int variable = inputStorage.readUnsignedByte();
61  std::string id = inputStorage.readString();
62  // check variable
63  if (variable != VAR_TIME_STEP
64  && variable != VAR_LOADED_VEHICLES_NUMBER && variable != VAR_LOADED_VEHICLES_IDS
65  && variable != VAR_DEPARTED_VEHICLES_NUMBER && variable != VAR_DEPARTED_VEHICLES_IDS
68  && variable != VAR_ARRIVED_VEHICLES_NUMBER && variable != VAR_ARRIVED_VEHICLES_IDS
69  && variable != VAR_DELTA_T && variable != VAR_NET_BOUNDING_BOX
70  && variable != VAR_MIN_EXPECTED_VEHICLES
71  && variable != POSITION_CONVERSION && variable != DISTANCE_REQUEST
72  && variable != VAR_BUS_STOP_WAITING
77  ) {
78  return server.writeErrorStatusCmd(CMD_GET_SIM_VARIABLE, "Get Simulation Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
79  }
80  // begin response building
81  tcpip::Storage tempMsg;
82  // response-code, variableID, objectID
84  tempMsg.writeUnsignedByte(variable);
85  tempMsg.writeString(id);
86  // process request
87  switch (variable) {
88  case VAR_TIME_STEP:
90  tempMsg.writeInt((int)MSNet::getInstance()->getCurrentTimeStep());
91  break;
94  break;
96  const std::vector<std::string>& ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_BUILT)->second;
98  tempMsg.writeStringList(ids);
99  }
100  break;
103  break;
106  break;
109  break;
112  break;
115  break;
118  break;
121  break;
124  break;
127  break;
130  break;
133  break;
136  break;
139  break;
142  break;
145  break;
148  break;
149  case VAR_DELTA_T:
151  tempMsg.writeInt((int)DELTA_T);
152  break;
153  case VAR_NET_BOUNDING_BOX: {
156  tempMsg.writeDouble(b.xmin());
157  tempMsg.writeDouble(b.ymin());
158  tempMsg.writeDouble(b.xmax());
159  tempMsg.writeDouble(b.ymax());
160  break;
161  }
162  break;
165  tempMsg.writeInt(MSNet::getInstance()->getVehicleControl().getActiveVehicleCount() + MSNet::getInstance()->getInsertionControl().getPendingFlowCount());
166  break;
167  case POSITION_CONVERSION:
168  if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) {
169  return server.writeErrorStatusCmd(CMD_GET_SIM_VARIABLE, "Position conversion requires a compound object.", outputStorage);
170  }
171  if (inputStorage.readInt() != 2) {
172  return server.writeErrorStatusCmd(CMD_GET_SIM_VARIABLE, "Position conversion requires a source position and a position type as parameter.", outputStorage);
173  }
174  if (!commandPositionConversion(server, inputStorage, tempMsg, CMD_GET_SIM_VARIABLE)) {
175  return false;
176  }
177  break;
178  case DISTANCE_REQUEST:
179  if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) {
180  return server.writeErrorStatusCmd(CMD_GET_SIM_VARIABLE, "Retrieval of distance requires a compound object.", outputStorage);
181  }
182  if (inputStorage.readInt() != 3) {
183  return server.writeErrorStatusCmd(CMD_GET_SIM_VARIABLE, "Retrieval of distance requires two positions and a distance type as parameter.", outputStorage);
184  }
185  if (!commandDistanceRequest(server, inputStorage, tempMsg, CMD_GET_SIM_VARIABLE)) {
186  return false;
187  }
188  break;
189  case VAR_BUS_STOP_WAITING: {
190  std::string id;
191  if (!server.readTypeCheckingString(inputStorage, id)) {
192  return server.writeErrorStatusCmd(CMD_GET_SIM_VARIABLE, "Retrieval of persons at busstop requires a string.", outputStorage);
193  }
195  if (s == 0) {
196  return server.writeErrorStatusCmd(CMD_GET_SIM_VARIABLE, "Unknown bus stop '" + id + "'.", outputStorage);
197  }
199  tempMsg.writeInt(s->getTransportableNumber());
200  break;
201  }
202  default:
203  break;
204  }
205  server.writeStatusCmd(CMD_GET_SIM_VARIABLE, RTYPE_OK, "", outputStorage);
206  server.writeResponseWithLength(outputStorage, tempMsg);
207  return true;
208 }
209 
210 
211 bool
213  tcpip::Storage& outputStorage) {
214  std::string warning = ""; // additional description for response
215  // variable
216  int variable = inputStorage.readUnsignedByte();
217  if (variable != CMD_CLEAR_PENDING_VEHICLES
218  && variable != CMD_SAVE_SIMSTATE) {
219  return server.writeErrorStatusCmd(CMD_SET_SIM_VARIABLE, "Set Simulation Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
220  }
221  // id
222  std::string id = inputStorage.readString();
223  // process
224  switch (variable) {
226  //clear any pending vehicle insertions
227  std::string route;
228  if (!server.readTypeCheckingString(inputStorage, route)) {
229  return server.writeErrorStatusCmd(CMD_SET_SIM_VARIABLE, "A string is needed for clearing pending vehicles.", outputStorage);
230  }
232  }
233  break;
234  case CMD_SAVE_SIMSTATE: {
235  //save current simulation state
236  std::string file;
237  if (!server.readTypeCheckingString(inputStorage, file)) {
238  return server.writeErrorStatusCmd(CMD_SET_SIM_VARIABLE, "A string is needed for saving simulation state.", outputStorage);
239  }
240  MSStateHandler::saveState(file, MSNet::getInstance()->getCurrentTimeStep());
241  }
242  break;
243  default:
244  break;
245  }
246  server.writeStatusCmd(CMD_SET_SIM_VARIABLE, RTYPE_OK, warning, outputStorage);
247  return true;
248 }
249 
250 
251 void
253  const std::vector<std::string>& ids = server.getVehicleStateChanges().find(state)->second;
254  outputStorage.writeUnsignedByte(TYPE_INTEGER);
255  outputStorage.writeInt((int) ids.size());
256 }
257 
258 
259 void
261  const std::vector<std::string>& ids = server.getVehicleStateChanges().find(state)->second;
262  outputStorage.writeUnsignedByte(TYPE_STRINGLIST);
263  outputStorage.writeStringList(ids);
264 }
265 
266 
267 std::pair<MSLane*, SUMOReal>
269  std::pair<MSLane*, SUMOReal> result;
270  std::vector<std::string> allEdgeIds;
272 
273  allEdgeIds = MSNet::getInstance()->getEdgeControl().getEdgeNames();
274  for (std::vector<std::string>::iterator itId = allEdgeIds.begin(); itId != allEdgeIds.end(); itId++) {
275  const std::vector<MSLane*>& allLanes = MSEdge::dictionary((*itId))->getLanes();
276  for (std::vector<MSLane*>::const_iterator itLane = allLanes.begin(); itLane != allLanes.end(); itLane++) {
277  const SUMOReal newDistance = (*itLane)->getShape().distance(pos);
278  if (newDistance < minDistance) {
279  minDistance = newDistance;
280  result.first = (*itLane);
281  }
282  }
283  }
284  // @todo this may be a place where 3D is required but 2D is delivered
285  result.second = result.first->getShape().nearest_offset_to_point2D(pos, false);
286  return result;
287 }
288 
289 
290 const MSLane*
291 TraCIServerAPI_Simulation::getLaneChecking(std::string roadID, int laneIndex, SUMOReal pos) {
292  const MSEdge* edge = MSEdge::dictionary(roadID);
293  if (edge == 0) {
294  throw TraCIException("Unknown edge " + roadID);
295  }
296  if (laneIndex < 0 || laneIndex >= (int)edge->getLanes().size()) {
297  throw TraCIException("Invalid lane index for " + roadID);
298  }
299  const MSLane* lane = edge->getLanes()[laneIndex];
300  if (pos < 0 || pos > lane->getLength()) {
301  throw TraCIException("Position on lane invalid");
302  }
303  return lane;
304 }
305 
306 
307 bool
309  tcpip::Storage& outputStorage, int commandId) {
310  std::pair<MSLane*, SUMOReal> roadPos;
311  Position cartesianPos;
312  Position geoPos;
313  SUMOReal z = 0;
314 
315  // actual position type that will be converted
316  int srcPosType = inputStorage.readUnsignedByte();
317 
318  switch (srcPosType) {
319  case POSITION_2D:
320  case POSITION_3D:
321  case POSITION_LON_LAT:
322  case POSITION_LON_LAT_ALT: {
323  SUMOReal x = inputStorage.readDouble();
324  SUMOReal y = inputStorage.readDouble();
325  if (srcPosType != POSITION_2D && srcPosType != POSITION_LON_LAT) {
326  z = inputStorage.readDouble();
327  }
328  geoPos.set(x, y);
329  cartesianPos.set(x, y);
330  if (srcPosType == POSITION_LON_LAT || srcPosType == POSITION_LON_LAT_ALT) {
332  } else {
334  }
335  }
336  break;
337  case POSITION_ROADMAP: {
338  std::string roadID = inputStorage.readString();
339  SUMOReal pos = inputStorage.readDouble();
340  int laneIdx = inputStorage.readUnsignedByte();
341  try {
342  // convert edge,offset,laneIdx to cartesian position
343  cartesianPos = geoPos = getLaneChecking(roadID, laneIdx, pos)->getShape().positionAtOffset(pos);
344  z = cartesianPos.z();
346  } catch (TraCIException& e) {
347  server.writeStatusCmd(commandId, RTYPE_ERR, e.what());
348  return false;
349  }
350  }
351  break;
352  default:
353  server.writeStatusCmd(commandId, RTYPE_ERR, "Source position type not supported");
354  return false;
355  }
356 
357  int destPosType = 0;
358  if (!server.readTypeCheckingUnsignedByte(inputStorage, destPosType)) {
359  server.writeStatusCmd(commandId, RTYPE_ERR, "Destination position type must be of type ubyte.");
360  return false;
361  }
362 
363  switch (destPosType) {
364  case POSITION_ROADMAP: {
365  // convert cartesion position to edge,offset,lane_index
366  roadPos = convertCartesianToRoadMap(cartesianPos);
367  // write result that is added to response msg
368  outputStorage.writeUnsignedByte(POSITION_ROADMAP);
369  outputStorage.writeString(roadPos.first->getEdge().getID());
370  outputStorage.writeDouble(roadPos.second);
371  const std::vector<MSLane*> lanes = roadPos.first->getEdge().getLanes();
372  outputStorage.writeUnsignedByte((int)distance(lanes.begin(), find(lanes.begin(), lanes.end(), roadPos.first)));
373  }
374  break;
375  case POSITION_2D:
376  case POSITION_3D:
377  case POSITION_LON_LAT:
379  outputStorage.writeUnsignedByte(destPosType);
380  if (destPosType == POSITION_LON_LAT || destPosType == POSITION_LON_LAT_ALT) {
381  outputStorage.writeDouble(geoPos.x());
382  outputStorage.writeDouble(geoPos.y());
383  } else {
384  outputStorage.writeDouble(cartesianPos.x());
385  outputStorage.writeDouble(cartesianPos.y());
386  }
387  if (destPosType != POSITION_2D && destPosType != POSITION_LON_LAT) {
388  outputStorage.writeDouble(z);
389  }
390  break;
391  default:
392  server.writeStatusCmd(commandId, RTYPE_ERR, "Destination position type not supported");
393  return false;
394  }
395  return true;
396 }
397 
398 /****************************************************************************/
399 
400 bool
402  tcpip::Storage& outputStorage, int commandId) {
403  Position pos1;
404  Position pos2;
405  std::pair<const MSLane*, SUMOReal> roadPos1;
406  std::pair<const MSLane*, SUMOReal> roadPos2;
407 
408  // read position 1
409  int posType = inputStorage.readUnsignedByte();
410  switch (posType) {
411  case POSITION_ROADMAP:
412  try {
413  std::string roadID = inputStorage.readString();
414  roadPos1.second = inputStorage.readDouble();
415  roadPos1.first = getLaneChecking(roadID, inputStorage.readUnsignedByte(), roadPos1.second);
416  pos1 = roadPos1.first->getShape().positionAtOffset(roadPos1.second);
417  } catch (TraCIException& e) {
418  server.writeStatusCmd(commandId, RTYPE_ERR, e.what());
419  return false;
420  }
421  break;
422  case POSITION_2D:
423  case POSITION_3D: {
424  SUMOReal p1x = inputStorage.readDouble();
425  SUMOReal p1y = inputStorage.readDouble();
426  pos1.set(p1x, p1y);
427  }
428  if (posType == POSITION_3D) {
429  inputStorage.readDouble();// z value is ignored
430  }
431  roadPos1 = convertCartesianToRoadMap(pos1);
432  break;
433  default:
434  server.writeStatusCmd(commandId, RTYPE_ERR, "Unknown position format used for distance request");
435  return false;
436  }
437 
438  // read position 2
439  posType = inputStorage.readUnsignedByte();
440  switch (posType) {
441  case POSITION_ROADMAP:
442  try {
443  std::string roadID = inputStorage.readString();
444  roadPos2.second = inputStorage.readDouble();
445  roadPos2.first = getLaneChecking(roadID, inputStorage.readUnsignedByte(), roadPos2.second);
446  pos2 = roadPos2.first->getShape().positionAtOffset(roadPos2.second);
447  } catch (TraCIException& e) {
448  server.writeStatusCmd(commandId, RTYPE_ERR, e.what());
449  return false;
450  }
451  break;
452  case POSITION_2D:
453  case POSITION_3D: {
454  SUMOReal p2x = inputStorage.readDouble();
455  SUMOReal p2y = inputStorage.readDouble();
456  pos2.set(p2x, p2y);
457  }
458  if (posType == POSITION_3D) {
459  inputStorage.readDouble();// z value is ignored
460  }
461  roadPos2 = convertCartesianToRoadMap(pos2);
462  break;
463  default:
464  server.writeStatusCmd(commandId, RTYPE_ERR, "Unknown position format used for distance request");
465  return false;
466  }
467 
468  // read distance type
469  int distType = inputStorage.readUnsignedByte();
470 
471  SUMOReal distance = 0.0;
472  if (distType == REQUEST_DRIVINGDIST) {
473  // compute driving distance
474  if ((roadPos1.first == roadPos2.first) && (roadPos1.second <= roadPos2.second)) {
475  // same edge
476  distance = roadPos2.second - roadPos1.second;
477  } else {
478  ConstMSEdgeVector newRoute;
480  &roadPos1.first->getEdge(), &roadPos2.first->getEdge(), 0, MSNet::getInstance()->getCurrentTimeStep(), newRoute);
481  MSRoute route("", newRoute, false, 0, std::vector<SUMOVehicleParameter::Stop>());
482  distance = route.getDistanceBetween(roadPos1.second, roadPos2.second, &roadPos1.first->getEdge(), &roadPos2.first->getEdge());
483  }
484  } else {
485  // compute air distance (default)
486  distance = pos1.distanceTo(pos2);
487  }
488  // write response command
489  outputStorage.writeUnsignedByte(TYPE_DOUBLE);
490  outputStorage.writeDouble(distance);
491  return true;
492 }
493 
494 
495 #endif
496 
497 /****************************************************************************/
The vehicle has departed (was inserted into the network)
Definition: MSNet.h:530
#define CMD_CLEAR_PENDING_VEHICLES
#define VAR_TIME_STEP
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
#define REQUEST_DRIVINGDIST
static void writeVehicleStateIDs(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
unsigned int getTransportableNumber() const
Returns the number of transportables waiting on this stop.
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation. ...
#define TYPE_COMPOUND
#define POSITION_2D
A lane area vehicles can halt at.
#define VAR_PARKING_STARTING_VEHICLES_IDS
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:185
static const MSLane * getLaneChecking(std::string roadID, int laneIndex, SUMOReal pos)
std::vector< std::string > getEdgeNames() const
Returns the list of names of all known edges.
#define VAR_STOP_ENDING_VEHICLES_IDS
#define VAR_PARKING_ENDING_VEHICLES_NUMBER
SUMOReal ymin() const
Returns minimum y-coordinate.
Definition: Boundary.cpp:124
SUMOReal getLength() const
Returns the lane&#39;s length.
Definition: MSLane.h:375
#define POSITION_LON_LAT_ALT
#define RTYPE_OK
#define POSITION_ROADMAP
#define DISTANCE_REQUEST
virtual double readDouble()
SUMOReal xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:112
#define VAR_LOADED_VEHICLES_IDS
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xab: Get Simulation Variable)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:160
virtual bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...
SUMOTime DELTA_T
Definition: SUMOTime.cpp:39
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
#define TYPE_STRINGLIST
#define RESPONSE_GET_SIM_VARIABLE
#define POSITION_3D
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
#define VAR_TELEPORT_STARTING_VEHICLES_IDS
static std::pair< MSLane *, SUMOReal > convertCartesianToRoadMap(Position pos)
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:78
SUMOReal distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Definition: Position.h:221
virtual void writeUnsignedByte(int)
#define POSITION_LON_LAT
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:255
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_LOADED_VEHICLES_NUMBER
SUMOReal x() const
Returns the x-position.
Definition: Position.h:63
SUMOReal xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:118
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
#define VAR_STOP_STARTING_VEHICLES_NUMBER
static void writeVehicleStateNumber(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
virtual void writeInt(int)
virtual int readUnsignedByte()
The vehicles starts to stop.
Definition: MSNet.h:544
#define POSITION_CONVERSION
A road/street connecting two junctions.
Definition: MSEdge.h:80
#define CMD_SAVE_SIMSTATE
#define VAR_DEPARTED_VEHICLES_NUMBER
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xcb: Set Simulation Variable)
#define max(a, b)
Definition: polyfonts.c:65
#define VAR_MIN_EXPECTED_VEHICLES
The vehicle arrived at his destination (is deleted)
Definition: MSNet.h:536
MSStoppingPlace * getBusStop(const std::string &id) const
Returns the named bus stop.
Definition: MSNet.cpp:780
The vehicles starts to park.
Definition: MSNet.h:540
virtual int readInt()
SUMOReal getDistanceBetween(SUMOReal fromPos, SUMOReal toPos, const MSEdge *fromEdge, const MSEdge *toEdge, bool includeInternal=true) const
Compute the distance between 2 given edges on this route, including the length of internal lanes...
Definition: MSRoute.cpp:285
const std::map< MSNet::VehicleState, std::vector< std::string > > & getVehicleStateChanges() const
Definition: TraCIServer.h:158
#define VAR_STOP_STARTING_VEHICLES_IDS
#define VAR_NET_BOUNDING_BOX
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
#define VAR_TELEPORT_STARTING_VEHICLES_NUMBER
#define TYPE_BOUNDINGBOX
SUMOReal z() const
Returns the z-position.
Definition: Position.h:73
virtual void writeStringList(const std::vector< std::string > &s)
static bool commandPositionConversion(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId)
#define VAR_TELEPORT_ENDING_VEHICLES_IDS
Position positionAtOffset(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
The vehicle started to teleport.
Definition: MSNet.h:532
#define CMD_GET_SIM_VARIABLE
virtual std::string readString()
#define VAR_DEPARTED_VEHICLES_IDS
void clearPendingVehicles(std::string &route)
clears out all pending vehicles from a route, "" for all routes
The vehicle ends to park.
Definition: MSNet.h:542
const Boundary & getConvBoundary() const
Returns the converted boundary.
bool readTypeCheckingUnsignedByte(tcpip::Storage &inputStorage, int &into)
Reads the value type and an unsigned byte, verifying the type.
#define VAR_DELTA_T
TraCI server used to control sumo by a remote TraCI client.
Definition: TraCIServer.h:73
#define CMD_SET_SIM_VARIABLE
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
VehicleState
Definition of a vehicle state.
Definition: MSNet.h:526
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:847
static bool commandDistanceRequest(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId)
The vehicle was built, but has not yet departed.
Definition: MSNet.h:528
#define VAR_ARRIVED_VEHICLES_NUMBER
virtual void writeString(const std::string &s)
#define TYPE_DOUBLE
std::string toHex(const T i, std::streamsize numDigits=0)
Definition: ToString.h:64
#define VAR_STOP_ENDING_VEHICLES_NUMBER
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Definition: MSNet.h:349
SUMOReal y() const
Returns the y-position.
Definition: Position.h:68
void set(SUMOReal x, SUMOReal y)
Definition: Position.h:78
#define VAR_PARKING_ENDING_VEHICLES_IDS
The vehicle ends to stop.
Definition: MSNet.h:546
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
virtual void writeDouble(double)
#define VAR_TELEPORT_ENDING_VEHICLES_NUMBER
const PositionVector & getShape() const
Returns this lane&#39;s shape.
Definition: MSLane.h:322
#define SUMOReal
Definition: config.h:213
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
SUMOReal ymax() const
Returns maximum y-coordinate.
Definition: Boundary.cpp:130
MSEdgeControl & getEdgeControl()
Returns the edge control.
Definition: MSNet.h:339
#define VAR_PARKING_STARTING_VEHICLES_NUMBER
#define RTYPE_ERR
#define TYPE_INTEGER
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
#define VAR_ARRIVED_VEHICLES_IDS
The vehicle ended being teleported.
Definition: MSNet.h:534
#define VAR_BUS_STOP_WAITING
static void saveState(const std::string &file, SUMOTime step)
Saves the current state.