Eclipse SUMO - Simulation of Urban MObility
libtraci/Simulation.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2017-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // C++ TraCI client API implementation
20 /****************************************************************************/
21 #include <config.h>
22 #include <cstdlib>
23 
24 #include <foreign/tcpip/socket.h>
25 #define LIBTRACI 1
26 #include "Connection.h"
27 #include "Domain.h"
28 #include <libsumo/StorageHelper.h>
29 #include <libsumo/GUI.h>
30 #include <libsumo/Simulation.h>
31 
32 
33 namespace libtraci {
34 
35 typedef Domain<libsumo::CMD_GET_SIM_VARIABLE, libsumo::CMD_SET_SIM_VARIABLE> Dom;
36 
37 
38 // ===========================================================================
39 // static member definitions
40 // ===========================================================================
41 std::pair<int, std::string>
42 Simulation::init(int port, int numRetries, const std::string& host, const std::string& label, FILE* const pipe) {
43  Connection::connect(host, port, numRetries, label, pipe);
44  switchConnection(label);
45  return getVersion();
46 }
47 
48 
49 std::pair<int, std::string>
50 Simulation::start(const std::vector<std::string>& cmd, int port, int numRetries, const std::string& label, const bool verbose,
51  const std::string& /* traceFile */, bool /* traceGetters */, void* /* _stdout */) {
52  if (port == -1) {
54  }
55  std::ostringstream oss;
56  for (const std::string& s : cmd) {
57  oss << s << " ";
58  }
59  oss << "--remote-port " << port << " 2>&1";
60 #ifndef WIN32
61  oss << " &";
62 #endif
63  if (verbose) {
64  std::cout << "Calling " << oss.str() << std::endl;
65  }
66 #ifdef WIN32
67  FILE* pipe = _popen(oss.str().c_str(), "r");
68 #else
69  FILE* pipe = popen(oss.str().c_str(), "r");
70 #endif
71  return init(port, numRetries, "localhost", label, pipe);
72 }
73 
74 
75 bool
76 Simulation::isLibsumo() {
77  return false;
78 }
79 
80 
81 bool
82 Simulation::hasGUI() {
83  try {
84  GUI::getIDList();
85  return true;
86  } catch (libsumo::TraCIException&) {
87  return false;
88  }
89 }
90 
91 
92 void
93 Simulation::switchConnection(const std::string& label) {
94  Connection::switchCon(label);
95 }
96 
97 
98 const std::string&
99 Simulation::getLabel() {
100  return Connection::getActive().getLabel();
101 }
102 
103 
104 void
105 Simulation::setOrder(int order) {
107 }
108 
109 
110 void
111 Simulation::load(const std::vector<std::string>& args) {
112  std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
113  tcpip::Storage content;
115  content.writeStringList(args);
117 }
118 
119 
120 bool
121 Simulation::isLoaded() {
122  return Connection::isActive();
123 }
124 
125 
126 void
127 Simulation::step(const double time) {
129 }
130 
131 
132 void
133 Simulation::executeMove() {
134  std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
136 }
137 
138 
139 void
140 Simulation::close(const std::string& /* reason */) {
142 }
143 
144 
145 std::pair<int, std::string>
146 Simulation::getVersion() {
147  std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
149  inMsg.readUnsignedByte(); // msg length
150  inMsg.readUnsignedByte(); // libsumo::CMD_GETVERSION again, see #7284
151  const int traciVersion = inMsg.readInt(); // to fix evaluation order
152  return std::make_pair(traciVersion, inMsg.readString());
153 }
154 
155 
156 std::string
157 Simulation::getOption(const std::string& option) {
158  return Dom::getString(libsumo::VAR_OPTION, option);
159 }
160 
161 
162 int
163 Simulation::getCurrentTime() {
165 }
166 
167 
168 double
169 Simulation::getTime() {
170  return Dom::getDouble(libsumo::VAR_TIME, "");
171 }
172 
173 
174 double
175 Simulation::getEndTime() {
176  return Dom::getDouble(libsumo::VAR_END, "");
177 }
178 
179 
180 int
181 Simulation::getLoadedNumber() {
183 }
184 
185 
186 std::vector<std::string>
187 Simulation::getLoadedIDList() {
189 }
190 
191 
192 int
193 Simulation::getDepartedNumber() {
195 }
196 
197 
198 std::vector<std::string>
199 Simulation::getDepartedIDList() {
201 }
202 
203 
204 int
205 Simulation::getArrivedNumber() {
207 }
208 
209 
210 std::vector<std::string>
211 Simulation::getArrivedIDList() {
213 }
214 
215 
216 int
217 Simulation::getParkingStartingVehiclesNumber() {
219 }
220 
221 
222 std::vector<std::string>
223 Simulation::getParkingStartingVehiclesIDList() {
225 }
226 
227 
228 int
229 Simulation::getParkingEndingVehiclesNumber() {
231 }
232 
233 
234 std::vector<std::string>
235 Simulation::getParkingEndingVehiclesIDList() {
237 }
238 
239 
240 int
241 Simulation::getStopStartingVehiclesNumber() {
243 }
244 
245 
246 std::vector<std::string>
247 Simulation::getStopStartingVehiclesIDList() {
249 }
250 
251 
252 int
253 Simulation::getStopEndingVehiclesNumber() {
255 }
256 
257 
258 std::vector<std::string>
259 Simulation::getStopEndingVehiclesIDList() {
261 }
262 
263 
264 int
265 Simulation::getCollidingVehiclesNumber() {
267 }
268 
269 
270 std::vector<std::string>
271 Simulation::getCollidingVehiclesIDList() {
273 }
274 
275 
276 int
277 Simulation::getEmergencyStoppingVehiclesNumber() {
279 }
280 
281 
282 std::vector<std::string>
283 Simulation::getEmergencyStoppingVehiclesIDList() {
285 }
286 
287 
288 int
289 Simulation::getStartingTeleportNumber() {
291 }
292 
293 
294 std::vector<std::string>
295 Simulation::getStartingTeleportIDList() {
297 }
298 
299 
300 int
301 Simulation::getEndingTeleportNumber() {
303 }
304 
305 
306 std::vector<std::string>
307 Simulation::getEndingTeleportIDList() {
309 }
310 
311 
312 int
313 Simulation::getDepartedPersonNumber() {
315 }
316 
317 
318 std::vector<std::string>
319 Simulation::getDepartedPersonIDList() {
321 }
322 
323 
324 int
325 Simulation::getArrivedPersonNumber() {
327 }
328 
329 
330 std::vector<std::string>
331 Simulation::getArrivedPersonIDList() {
333 }
334 
335 
336 std::vector<std::string>
337 Simulation::getBusStopIDList() {
339 }
340 
341 int
342 Simulation::getBusStopWaiting(const std::string& stopID) {
344 }
345 
346 std::vector<std::string>
347 Simulation::getBusStopWaitingIDList(const std::string& stopID) {
349 }
350 
351 
352 std::vector<std::string>
353 Simulation::getPendingVehicles() {
355 }
356 
357 
358 std::vector<libsumo::TraCICollision>
359 Simulation::getCollisions() {
360  std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
362  std::vector<libsumo::TraCICollision> result;
364  int numCollisions = ret.readInt();
365  while (numCollisions-- > 0) {
375  c.pos = StoHelp::readTypedDouble(ret);
376  result.emplace_back(c);
377  }
378  return result;
379 }
380 
381 
382 double
383 Simulation::getScale() {
385 }
386 
387 
388 double
389 Simulation::getDeltaT() {
391 }
392 
393 
395 Simulation::getNetBoundary() {
397 }
398 
399 
400 int
401 Simulation::getMinExpectedNumber() {
403 }
404 
405 
407 Simulation::convert2D(const std::string& edgeID, double pos, int laneIndex, bool toGeo) {
408  tcpip::Storage content;
409  StoHelp::writeCompound(content, 2);
411  content.writeString(edgeID);
412  content.writeDouble(pos);
413  content.writeUnsignedByte(laneIndex);
416  return Dom::getPos(libsumo::POSITION_CONVERSION, "", &content, toGeo);
417 }
418 
419 
421 Simulation::convert3D(const std::string& edgeID, double pos, int laneIndex, bool toGeo) {
422  tcpip::Storage content;
423  StoHelp::writeCompound(content, 2);
425  content.writeString(edgeID);
426  content.writeDouble(pos);
427  content.writeUnsignedByte(laneIndex);
430  return Dom::getPos3D(libsumo::POSITION_CONVERSION, "", &content, toGeo);
431 }
432 
433 
435 Simulation::convertRoad(double x, double y, bool isGeo, const std::string& vClass) {
436  tcpip::Storage content;
437  StoHelp::writeCompound(content, 3);
439  content.writeDouble(x);
440  content.writeDouble(y);
443  StoHelp::writeTypedString(content, vClass);
444  std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
447  result.edgeID = ret.readString();
448  result.pos = ret.readDouble();
449  result.laneIndex = ret.readByte();
450  return result;
451 }
452 
453 
455 Simulation::convertGeo(double x, double y, bool fromGeo) {
456  tcpip::Storage content;
457  StoHelp::writeCompound(content, 2);
459  content.writeDouble(x);
460  content.writeDouble(y);
463  return Dom::getPos(libsumo::POSITION_CONVERSION, "", &content, !fromGeo);
464 }
465 
466 
467 double
468 Simulation::getDistance2D(double x1, double y1, double x2, double y2, bool isGeo, bool isDriving) {
469  tcpip::Storage content;
470  StoHelp::writeCompound(content, 3);
472  content.writeDouble(x1);
473  content.writeDouble(y1);
475  content.writeDouble(x2);
476  content.writeDouble(y2);
478  return Dom::getDouble(libsumo::DISTANCE_REQUEST, "", &content);
479 }
480 
481 
482 double
483 Simulation::getDistanceRoad(const std::string& edgeID1, double pos1, const std::string& edgeID2, double pos2, bool isDriving) {
484  tcpip::Storage content;
485  StoHelp::writeCompound(content, 3);
487  content.writeString(edgeID1);
488  content.writeDouble(pos1);
489  content.writeUnsignedByte(0);
491  content.writeString(edgeID2);
492  content.writeDouble(pos2);
493  content.writeUnsignedByte(0);
495  return Dom::getDouble(libsumo::DISTANCE_REQUEST, "", &content);
496 }
497 
498 
500 Simulation::findRoute(const std::string& fromEdge, const std::string& toEdge, const std::string& vType, const double depart, const int routingMode) {
501  tcpip::Storage content;
502  StoHelp::writeCompound(content, 5);
503  StoHelp::writeTypedString(content, fromEdge);
504  StoHelp::writeTypedString(content, toEdge);
505  StoHelp::writeTypedString(content, vType);
506  StoHelp::writeTypedDouble(content, depart);
507  StoHelp::writeTypedInt(content, routingMode);
508  return Dom::getTraCIStage(libsumo::FIND_ROUTE, "", &content);
509 }
510 
511 
512 std::vector<libsumo::TraCIStage>
513 Simulation::findIntermodalRoute(const std::string& fromEdge, const std::string& toEdge,
514  const std::string& modes, double depart, const int routingMode, double speed, double walkFactor,
515  double departPos, double arrivalPos, const double departPosLat,
516  const std::string& pType, const std::string& vType, const std::string& destStop) {
517  tcpip::Storage content;
518  StoHelp::writeCompound(content, 13);
519  StoHelp::writeTypedString(content, fromEdge);
520  StoHelp::writeTypedString(content, toEdge);
521  StoHelp::writeTypedString(content, modes);
522  StoHelp::writeTypedDouble(content, depart);
523  StoHelp::writeTypedInt(content, routingMode);
524  StoHelp::writeTypedDouble(content, speed);
525  StoHelp::writeTypedDouble(content, walkFactor);
526  StoHelp::writeTypedDouble(content, departPos);
527  StoHelp::writeTypedDouble(content, arrivalPos);
528  StoHelp::writeTypedDouble(content, departPosLat);
529  StoHelp::writeTypedString(content, pType);
530  StoHelp::writeTypedString(content, vType);
531  StoHelp::writeTypedString(content, destStop);
532  std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
533  tcpip::Storage& result = Dom::get(libsumo::FIND_INTERMODAL_ROUTE, "", &content);
534  int numStages = result.readInt();
535  std::vector<libsumo::TraCIStage> ret;
536  while (numStages-- > 0) {
538  StoHelp::readCompound(result, 13);
539  s.type = StoHelp::readTypedInt(result);
540  s.vType = StoHelp::readTypedString(result);
541  s.line = StoHelp::readTypedString(result);
545  s.cost = StoHelp::readTypedDouble(result);
546  s.length = StoHelp::readTypedDouble(result);
548  s.depart = StoHelp::readTypedDouble(result);
552  ret.emplace_back(s);
553  }
554  return ret;
555 }
556 
557 LIBTRACI_PARAMETER_IMPLEMENTATION(Simulation, SIM)
558 
559 void
560 Simulation::setScale(double value) {
562 }
563 
564 void
565 Simulation::clearPending(const std::string& routeID) {
567 }
568 
569 
570 void
571 Simulation::saveState(const std::string& fileName) {
573 }
574 
575 double
576 Simulation::loadState(const std::string& fileName) {
578  return 0.;
579 }
580 
581 void
582 Simulation::writeMessage(const std::string& msg) {
584 }
585 
586 
587 void
588 Simulation::subscribe(const std::vector<int>& varIDs, double begin, double end, const libsumo::TraCIResults& params) {
589  libtraci::Connection::getActive().subscribe(libsumo::CMD_SUBSCRIBE_SIM_VARIABLE, "", begin, end, -1, -1, varIDs, params);
590 }
591 
592 
594 Simulation::getSubscriptionResults() {
596 }
597 
598 
600 
601 }
602 
603 
604 /****************************************************************************/
#define LIBTRACI_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
Definition: Domain.h:38
#define LIBTRACI_PARAMETER_IMPLEMENTATION(CLASS, DOMAIN)
Definition: Domain.h:77
static void writeTypedDouble(tcpip::Storage &content, double value)
static int readCompound(tcpip::Storage &ret, int expectedSize=-1, const std::string &error="")
Definition: StorageHelper.h:85
static int readTypedInt(tcpip::Storage &ret, const std::string &error="")
Definition: StorageHelper.h:50
static void writeCompound(tcpip::Storage &content, int size)
static std::string readTypedString(tcpip::Storage &ret, const std::string &error="")
Definition: StorageHelper.h:71
static void writeTypedInt(tcpip::Storage &content, int value)
static std::vector< std::string > readTypedStringList(tcpip::Storage &ret, const std::string &error="")
Definition: StorageHelper.h:78
static void writeTypedString(tcpip::Storage &content, const std::string &value)
static double readTypedDouble(tcpip::Storage &ret, const std::string &error="")
Definition: StorageHelper.h:64
An error which allows to continue.
Definition: TraCIDefs.h:144
std::string intended
id of the intended vehicle for public transport ride
Definition: TraCIDefs.h:582
int type
The type of stage (walking, driving, ...)
Definition: TraCIDefs.h:566
std::string destStop
The id of the destination stop.
Definition: TraCIDefs.h:572
double length
length in m
Definition: TraCIDefs.h:580
double travelTime
duration of the stage in seconds
Definition: TraCIDefs.h:576
double departPos
position on the lane when starting the stage
Definition: TraCIDefs.h:586
std::string description
arbitrary description string
Definition: TraCIDefs.h:590
std::string line
The line or the id of the vehicle type.
Definition: TraCIDefs.h:570
double cost
effort needed
Definition: TraCIDefs.h:578
double depart
intended depart time for public transport ride or INVALID_DOUBLE_VALUE
Definition: TraCIDefs.h:584
std::vector< std::string > edges
The sequence of edges to travel.
Definition: TraCIDefs.h:574
double arrivalPos
position on the lane when ending the stage
Definition: TraCIDefs.h:588
std::string vType
The vehicle type when using a private car or bike.
Definition: TraCIDefs.h:568
void simulationStep(double time)
Sends a SimulationStep command.
Definition: Connection.cpp:121
static void connect(const std::string &host, int port, int numRetries, const std::string &label, FILE *const pipe)
Definition: Connection.h:53
static bool isActive()
Definition: Connection.h:64
void close()
ends the simulation and closes the connection
Definition: Connection.cpp:89
std::mutex & getMutex() const
Definition: Connection.h:76
static Connection & getActive()
Definition: Connection.h:57
void setOrder(int order)
Sends a SetOrder command.
Definition: Connection.cpp:150
void subscribe(int domID, const std::string &objID, double beginTime, double endTime, int domain, double range, const std::vector< int > &vars, const libsumo::TraCIResults &params)
Sends a SubscribeContext or a SubscribeVariable request.
Definition: Connection.cpp:204
const std::string & getLabel() const
Definition: Connection.h:72
tcpip::Storage & doCommand(int command, int var=-1, const std::string &id="", tcpip::Storage *add=nullptr, int expectedType=-1)
Definition: Connection.cpp:329
static void switchCon(const std::string &label)
Definition: Connection.h:68
libsumo::SubscriptionResults & getAllSubscriptionResults(const int domain)
Definition: Connection.h:83
static void setDouble(int var, const std::string &id, double value)
Definition: Domain.h:231
static libsumo::TraCIPosition getPos(int var, const std::string &id, tcpip::Storage *add=nullptr, const bool isGeo=false)
Definition: Domain.h:153
static std::vector< std::string > getStringVector(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:177
static std::string getString(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:172
static int getInt(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:125
static libsumo::TraCIStage getTraCIStage(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:198
static libsumo::TraCIPositionVector getPolygon(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:135
static libsumo::TraCIPosition getPos3D(int var, const std::string &id, tcpip::Storage *add=nullptr, const bool isGeo=false)
Definition: Domain.h:162
static double getDouble(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:130
static tcpip::Storage & get(int var, const std::string &id, tcpip::Storage *add=nullptr, int expectedType=libsumo::TYPE_COMPOUND)
Definition: Domain.h:111
static void setString(int var, const std::string &id, const std::string &value)
Definition: Domain.h:238
static int getFreeSocketPort()
Returns an free port on the system.
Definition: socket.cpp:118
virtual std::string readString()
Definition: storage.cpp:180
virtual void writeString(const std::string &s)
Definition: storage.cpp:197
virtual void writeDouble(double)
Definition: storage.cpp:354
virtual int readUnsignedByte()
Definition: storage.cpp:155
virtual void writeStringList(const std::vector< std::string > &s)
Definition: storage.cpp:247
virtual void writeUnsignedByte(int)
Definition: storage.cpp:165
virtual int readByte()
Definition: storage.cpp:128
virtual double readDouble()
Definition: storage.cpp:362
virtual int readInt()
Definition: storage.cpp:311
TRACI_CONST int VAR_MIN_EXPECTED_VEHICLES
TRACI_CONST int CMD_SAVE_SIMSTATE
TRACI_CONST int VAR_STOP_ENDING_VEHICLES_IDS
TRACI_CONST int CMD_SUBSCRIBE_SIM_VARIABLE
TRACI_CONST int CMD_LOAD
TRACI_CONST int POSITION_3D
TRACI_CONST int POSITION_ROADMAP
TRACI_CONST int VAR_ARRIVED_VEHICLES_NUMBER
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_NUMBER
TRACI_CONST int VAR_SCALE
TRACI_CONST int VAR_DEPARTED_VEHICLES_NUMBER
TRACI_CONST int CMD_LOAD_SIMSTATE
TRACI_CONST int VAR_COLLIDING_VEHICLES_NUMBER
TRACI_CONST int VAR_COLLISIONS
TRACI_CONST int CMD_CLEAR_PENDING_VEHICLES
TRACI_CONST int VAR_PARKING_ENDING_VEHICLES_IDS
TRACI_CONST int VAR_PARKING_STARTING_VEHICLES_IDS
TRACI_CONST int CMD_EXECUTEMOVE
TRACI_CONST int FIND_INTERMODAL_ROUTE
TRACI_CONST int VAR_DEPARTED_PERSONS_NUMBER
TRACI_CONST int TYPE_UBYTE
TRACI_CONST int VAR_END
TRACI_CONST int POSITION_2D
TRACI_CONST int VAR_ARRIVED_PERSONS_IDS
TRACI_CONST int VAR_TIME
TRACI_CONST int VAR_NET_BOUNDING_BOX
TRACI_CONST int TYPE_STRINGLIST
TRACI_CONST int VAR_PENDING_VEHICLES
TRACI_CONST int VAR_BUS_STOP_ID_LIST
TRACI_CONST int POSITION_LON_LAT
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_IDS
TRACI_CONST int VAR_BUS_STOP_WAITING_IDS
TRACI_CONST int VAR_DEPARTED_VEHICLES_IDS
TRACI_CONST int VAR_TELEPORT_ENDING_VEHICLES_NUMBER
TRACI_CONST int CMD_MESSAGE
TRACI_CONST int VAR_PARKING_ENDING_VEHICLES_NUMBER
TRACI_CONST int VAR_LOADED_VEHICLES_IDS
TRACI_CONST int VAR_DELTA_T
TRACI_CONST int REQUEST_DRIVINGDIST
TRACI_CONST int VAR_DEPARTED_PERSONS_IDS
TRACI_CONST int VAR_ARRIVED_PERSONS_NUMBER
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_IDS
TRACI_CONST int FIND_ROUTE
TRACI_CONST int VAR_STOP_ENDING_VEHICLES_NUMBER
TRACI_CONST int POSITION_CONVERSION
TRACI_CONST int DISTANCE_REQUEST
TRACI_CONST int VAR_LOADED_VEHICLES_NUMBER
TRACI_CONST int VAR_TELEPORT_ENDING_VEHICLES_IDS
TRACI_CONST int VAR_COLLIDING_VEHICLES_IDS
TRACI_CONST int VAR_TELEPORT_STARTING_VEHICLES_NUMBER
TRACI_CONST int VAR_TELEPORT_STARTING_VEHICLES_IDS
TRACI_CONST int CMD_GETVERSION
TRACI_CONST int REQUEST_AIRDIST
TRACI_CONST int VAR_BUS_STOP_WAITING
TRACI_CONST int VAR_TIME_STEP
TRACI_CONST int VAR_ARRIVED_VEHICLES_IDS
TRACI_CONST int RESPONSE_SUBSCRIBE_SIM_VARIABLE
TRACI_CONST int VAR_PARKING_STARTING_VEHICLES_NUMBER
TRACI_CONST int POSITION_LON_LAT_ALT
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER
std::map< int, std::shared_ptr< libsumo::TraCIResult > > TraCIResults
{variable->value}
Definition: TraCIDefs.h:335
TRACI_CONST int VAR_OPTION
Domain< libsumo::CMD_GET_BUSSTOP_VARIABLE, libsumo::CMD_SET_BUSSTOP_VARIABLE > Dom
std::string lane
The lane where the collision happended.
Definition: TraCIDefs.h:643
std::string type
The type of collision.
Definition: TraCIDefs.h:641
std::string collider
The ids of the participating vehicles and persons.
Definition: TraCIDefs.h:634
std::string victimType
Definition: TraCIDefs.h:637
double pos
The position of the collision along the lane.
Definition: TraCIDefs.h:645
std::string colliderType
Definition: TraCIDefs.h:636
A 2D or 3D-position, for 2D positions z == INVALID_DOUBLE_VALUE.
Definition: TraCIDefs.h:178
A list of positions.
Definition: TraCIDefs.h:234
An edgeId, position and laneIndex.
Definition: TraCIDefs.h:197