Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
TraCIServerAPI_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) 2001-2025 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/****************************************************************************/
21// APIs for getting/setting simulation values via TraCI
22/****************************************************************************/
23#include <config.h>
24
27#include <microsim/MSNet.h>
30#include <microsim/MSEdge.h>
31#include <microsim/MSLane.h>
32#include <microsim/MSVehicle.h>
36#include <libsumo/Helper.h>
37#include <libsumo/Simulation.h>
41
42
43// ===========================================================================
44// method definitions
45// ===========================================================================
46bool
48 tcpip::Storage& outputStorage) {
49 const int variable = inputStorage.readUnsignedByte();
50 const std::string id = inputStorage.readString();
52 try {
53 // unlike the other domains we cannot check here first whether libsumo::Simulation can handle it because the implementations for the state variables differ
54 switch (variable) {
57 break;
60 break;
63 break;
66 break;
69 break;
72 break;
75 break;
78 break;
81 break;
84 break;
87 break;
90 break;
93 break;
96 break;
99 break;
102 break;
105 break;
108 break;
111 break;
114 break;
117 break;
120 break;
123 break;
126 break;
129 break;
132 break;
135 break;
138 break;
140 std::vector<libsumo::TraCICollision> collisions = libsumo::Simulation::getCollisions();
142 const int cnt = 1 + (int)collisions.size() * 4;
143 server.getWrapperStorage().writeInt(cnt);
145 server.getWrapperStorage().writeInt((int)collisions.size());
146 for (const auto& c : collisions) {
148 server.getWrapperStorage().writeString(c.collider);
150 server.getWrapperStorage().writeString(c.victim);
152 server.getWrapperStorage().writeString(c.colliderType);
154 server.getWrapperStorage().writeString(c.victimType);
156 server.getWrapperStorage().writeDouble(c.colliderSpeed);
158 server.getWrapperStorage().writeDouble(c.victimSpeed);
160 server.getWrapperStorage().writeString(c.type);
162 server.getWrapperStorage().writeString(c.lane);
164 server.getWrapperStorage().writeDouble(c.pos);
165 }
166 break;
167 }
170 libsumo::TraCIPositionVector tb = libsumo::Simulation::getNetBoundary();
171 server.getWrapperStorage().writeByte(2);
172 server.getWrapperStorage().writeDouble(tb.value[0].x);
173 server.getWrapperStorage().writeDouble(tb.value[0].y);
174 server.getWrapperStorage().writeDouble(tb.value[1].x);
175 server.getWrapperStorage().writeDouble(tb.value[1].y);
176 break;
177 }
179 if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
180 return server.writeErrorStatusCmd(libsumo::CMD_GET_SIM_VARIABLE, "Position conversion requires a compound object.", outputStorage);
181 }
182 const int compoundSize = inputStorage.readInt();
183 if (compoundSize < 2 || compoundSize > 3) {
184 return server.writeErrorStatusCmd(libsumo::CMD_GET_SIM_VARIABLE, "Position conversion requires a source position and a position type as parameter.", outputStorage);
185 }
186 if (!commandPositionConversion(server, inputStorage, compoundSize, server.getWrapperStorage(), libsumo::CMD_GET_SIM_VARIABLE)) {
187 return false;
188 }
189 break;
190 }
192 if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
193 return server.writeErrorStatusCmd(libsumo::CMD_GET_SIM_VARIABLE, "Retrieval of distance requires a compound object.", outputStorage);
194 }
195 if (inputStorage.readInt() != 3) {
196 return server.writeErrorStatusCmd(libsumo::CMD_GET_SIM_VARIABLE, "Retrieval of distance requires two positions and a distance type as parameter.", outputStorage);
197 }
198 if (!commandDistanceRequest(server, inputStorage, server.getWrapperStorage(), libsumo::CMD_GET_SIM_VARIABLE)) {
199 return false;
200 }
201 break;
202 case libsumo::FIND_ROUTE: {
203 const int parameterCount = StoHelp::readCompound(inputStorage, -1, "Retrieval of a route requires a compound object.");
204 if (parameterCount < 5 || parameterCount > 7) {
205 return server.writeErrorStatusCmd(libsumo::CMD_GET_SIM_VARIABLE, "Retrieval of a route requires between five to seven parameters.", outputStorage);
206 }
207 const std::string from = StoHelp::readTypedString(inputStorage, "Retrieval of a route requires a string as first parameter.");
208 const std::string to = StoHelp::readTypedString(inputStorage, "Retrieval of a route requires a string as second parameter.");
209 const std::string vtype = StoHelp::readTypedString(inputStorage, "Retrieval of a route requires a string as third parameter.");
210 const double depart = StoHelp::readTypedDouble(inputStorage, "Retrieval of a route requires a double as fourth parameter.");
211 const int routingMode = StoHelp::readTypedInt(inputStorage, "Retrieval of a route requires an integer as fifth parameter.");
212 double departPos = 0.;
213 if (parameterCount > 5) {
214 departPos = StoHelp::readTypedDouble(inputStorage, "Retrieval of a route requires a double as sixth parameter.");
215 }
216 double arrivalPos = libsumo::INVALID_DOUBLE_VALUE;
217 if (parameterCount > 6) {
218 arrivalPos = StoHelp::readTypedDouble(inputStorage, "Retrieval of a route requires a double as seventh parameter.");
219 }
220 libsumo::StorageHelper::writeStage(server.getWrapperStorage(), libsumo::Simulation::findRoute(from, to, vtype, depart, routingMode, departPos, arrivalPos));
221 break;
222 }
224 StoHelp::readCompound(inputStorage, 13, "Retrieval of an intermodal route requires thirteen parameters.");
225 const std::string from = StoHelp::readTypedString(inputStorage, "Retrieval of a route requires a string as first parameter.");
226 const std::string to = StoHelp::readTypedString(inputStorage, "Retrieval of a route requires a string as second parameter.");
227 const std::string modes = StoHelp::readTypedString(inputStorage, "Retrieval of a route requires a string as third parameter.");
228 const double depart = StoHelp::readTypedDouble(inputStorage, "Retrieval of a route requires a double as fourth parameter.");
229 const int routingMode = StoHelp::readTypedInt(inputStorage, "Retrieval of a route requires an integer as fifth parameter.");
230 const double speed = StoHelp::readTypedDouble(inputStorage, "Retrieval of a route requires a double as sixth parameter.");
231 const double walkFactor = StoHelp::readTypedDouble(inputStorage, "Retrieval of a route requires a double as seventh parameter.");
232 const double departPos = StoHelp::readTypedDouble(inputStorage, "Retrieval of a route requires a double as eighth parameter.");
233 const double arrivalPos = StoHelp::readTypedDouble(inputStorage, "Retrieval of a route requires a double as ninth parameter.");
234 const double departPosLat = StoHelp::readTypedDouble(inputStorage, "Retrieval of a route requires a double as tenth parameter.");
235 const std::string ptype = StoHelp::readTypedString(inputStorage, "Retrieval of a route requires a string as eleventh parameter.");
236 const std::string vtype = StoHelp::readTypedString(inputStorage, "Retrieval of a route requires a string as twelfth parameter.");
237 const std::string destStop = StoHelp::readTypedString(inputStorage, "Retrieval of a route requires a string as thirteenth parameter.");
238 const std::vector<libsumo::TraCIStage>& result = libsumo::Simulation::findIntermodalRoute(from, to, modes, depart, routingMode, speed, walkFactor, departPos, arrivalPos, departPosLat, ptype, vtype, destStop);
240 server.getWrapperStorage().writeInt((int)result.size());
241 for (const libsumo::TraCIStage& s : result) {
243 }
244 break;
245 }
246 default:
247 if (!libsumo::Simulation::handleVariable(id, variable, &server, &inputStorage)) {
248 return server.writeErrorStatusCmd(libsumo::CMD_GET_SIM_VARIABLE, "Get Simulation Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
249 }
250 }
251 } catch (libsumo::TraCIException& e) {
252 return server.writeErrorStatusCmd(libsumo::CMD_GET_SIM_VARIABLE, e.what(), outputStorage);
253 }
255 server.writeResponseWithLength(outputStorage, server.getWrapperStorage());
256 return true;
257}
258
259
260bool
262 tcpip::Storage& outputStorage) {
263 std::string warning = ""; // additional description for response
264 // variable
265 int variable = inputStorage.readUnsignedByte();
267 && variable != libsumo::CMD_SAVE_SIMSTATE
268 && variable != libsumo::CMD_LOAD_SIMSTATE
269 && variable != libsumo::VAR_PARAMETER
270 && variable != libsumo::VAR_SCALE
271 && variable != libsumo::CMD_MESSAGE
272 ) {
273 return server.writeErrorStatusCmd(libsumo::CMD_SET_SIM_VARIABLE, "Set Simulation Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
274 }
275 // id
276 std::string id = inputStorage.readString();
277 // process
278 try {
279 switch (variable) {
280 case libsumo::VAR_SCALE: {
281 const double value = StoHelp::readTypedDouble(inputStorage, "A double is needed for setting traffic scale.");
282 if (value < 0.0) {
283 return server.writeErrorStatusCmd(libsumo::CMD_SET_SIM_VARIABLE, "Traffic scale may not be negative.", outputStorage);
284 }
285 libsumo::Simulation::setScale(value);
286 }
287 break;
289 //clear any pending vehicle insertions
290 libsumo::Simulation::clearPending(StoHelp::readTypedString(inputStorage, "A string is needed for clearing pending vehicles."));
291 break;
293 //save current simulation state
294 libsumo::Simulation::saveState(StoHelp::readTypedString(inputStorage, "A string is needed for saving simulation state."));
295 break;
297 //quick-load simulation state
298 const double time = libsumo::Simulation::loadState(StoHelp::readTypedString(inputStorage, "A string is needed for loading simulation state."));
300 }
301 break;
303 StoHelp::readCompound(inputStorage, 2, "A compound object of size 2 is needed for setting a parameter.");
304 const std::string name = StoHelp::readTypedString(inputStorage, "The name of the parameter must be given as a string.");
305 const std::string value = StoHelp::readTypedString(inputStorage, "The value of the parameter must be given as a string.");
306 libsumo::Simulation::setParameter(id, name, value);
307 break;
308 }
310 libsumo::Simulation::writeMessage(StoHelp::readTypedString(inputStorage, "A string is needed for adding a log message."));
311 break;
312 default:
313 break;
314 }
315 } catch (libsumo::TraCIException& e) {
316 return server.writeErrorStatusCmd(libsumo::CMD_SET_SIM_VARIABLE, e.what(), outputStorage);
317 }
318 server.writeStatusCmd(libsumo::CMD_SET_SIM_VARIABLE, libsumo::RTYPE_OK, warning, outputStorage);
319 return true;
320}
321
322
323void
325 const std::vector<std::string>& ids = server.getVehicleStateChanges().find(state)->second;
327 outputStorage.writeInt((int) ids.size());
328}
329
330
331void
333 const std::vector<std::string>& ids = server.getVehicleStateChanges().find(state)->second;
335 outputStorage.writeStringList(ids);
336}
337
338
339void
341 const std::vector<std::string>& ids = server.getTransportableStateChanges().find(state)->second;
343 outputStorage.writeInt((int)ids.size());
344}
345
346
347void
349 const std::vector<std::string>& ids = server.getTransportableStateChanges().find(state)->second;
351 outputStorage.writeStringList(ids);
352}
353
354
355bool
357 const int compoundSize, tcpip::Storage& outputStorage,
358 const int commandId) {
359 std::pair<MSLane*, double> roadPos;
360 Position cartesianPos;
361 Position geoPos;
362 double z = 0;
363
364 // actual position type that will be converted
365 int srcPosType = inputStorage.readUnsignedByte();
366
367 switch (srcPosType) {
372 const double x = inputStorage.readDouble();
373 const double y = inputStorage.readDouble();
374 if (srcPosType != libsumo::POSITION_2D && srcPosType != libsumo::POSITION_LON_LAT) {
375 z = inputStorage.readDouble();
376 }
377 geoPos.set(x, y);
378 cartesianPos.set(x, y);
379 if (srcPosType == libsumo::POSITION_LON_LAT || srcPosType == libsumo::POSITION_LON_LAT_ALT) {
381 } else {
383 }
384 }
385 break;
387 const std::string roadID = inputStorage.readString();
388 const double pos = inputStorage.readDouble();
389 const int laneIdx = inputStorage.readUnsignedByte();
390 try {
391 // convert edge,offset,laneIdx to cartesian position
392 cartesianPos = geoPos = libsumo::Helper::getLaneChecking(roadID, laneIdx, pos)->geometryPositionAtOffset(pos);
393 z = cartesianPos.z();
395 } catch (libsumo::TraCIException& e) {
396 server.writeStatusCmd(commandId, libsumo::RTYPE_ERR, e.what());
397 return false;
398 }
399 }
400 break;
401 default:
402 server.writeStatusCmd(commandId, libsumo::RTYPE_ERR, "Source position type not supported");
403 return false;
404 }
405
406 const int destPosType = StoHelp::readTypedUnsignedByte(inputStorage, "Destination position type must be of type ubyte.");
408 if (compoundSize == 3) {
409 inputStorage.readUnsignedByte();
410 const std::string& vClassString = inputStorage.readString();
411 if (!SumoVehicleClassStrings.hasString(vClassString)) {
412 server.writeStatusCmd(commandId, libsumo::RTYPE_ERR, "Unknown vehicle class '" + vClassString + "'.");
413 return false;
414 }
415 vClass = SumoVehicleClassStrings.get(vClassString);
416 }
417
418 switch (destPosType) {
420 // convert cartesion position to edge,offset,lane_index
421 roadPos = libsumo::Helper::convertCartesianToRoadMap(cartesianPos, vClass);
422 if (roadPos.first == nullptr) {
423 server.writeStatusCmd(commandId, libsumo::RTYPE_ERR, "No matching lane found.");
424 return false;
425 }
426 // write result that is added to response msg
428 outputStorage.writeString(roadPos.first->getEdge().getID());
429 outputStorage.writeDouble(roadPos.second);
430 outputStorage.writeUnsignedByte(roadPos.first->getIndex());
431 }
432 break;
437 outputStorage.writeUnsignedByte(destPosType);
438 if (destPosType == libsumo::POSITION_LON_LAT || destPosType == libsumo::POSITION_LON_LAT_ALT) {
439 outputStorage.writeDouble(geoPos.x());
440 outputStorage.writeDouble(geoPos.y());
441 } else {
442 outputStorage.writeDouble(cartesianPos.x());
443 outputStorage.writeDouble(cartesianPos.y());
444 }
445 if (destPosType != libsumo::POSITION_2D && destPosType != libsumo::POSITION_LON_LAT) {
446 outputStorage.writeDouble(z);
447 }
448 break;
449 default:
450 server.writeStatusCmd(commandId, libsumo::RTYPE_ERR, "Destination position type not supported");
451 return false;
452 }
453 return true;
454}
455
456
457bool
459 tcpip::Storage& outputStorage, int commandId) {
460 Position pos1;
461 Position pos2;
462 std::pair<const MSLane*, double> roadPos1;
463 std::pair<const MSLane*, double> roadPos2;
464
465 // read position 1
466 int posType = inputStorage.readUnsignedByte();
467 switch (posType) {
469 try {
470 std::string roadID = inputStorage.readString();
471 roadPos1.second = inputStorage.readDouble();
472 roadPos1.first = libsumo::Helper::getLaneChecking(roadID, inputStorage.readUnsignedByte(), roadPos1.second);
473 pos1 = roadPos1.first->geometryPositionAtOffset(roadPos1.second);
474 } catch (libsumo::TraCIException& e) {
475 server.writeStatusCmd(commandId, libsumo::RTYPE_ERR, e.what());
476 return false;
477 }
478 break;
481 double p1x = inputStorage.readDouble();
482 double p1y = inputStorage.readDouble();
483 pos1.set(p1x, p1y);
484 }
485 if (posType == libsumo::POSITION_3D) {
486 inputStorage.readDouble();// z value is ignored
487 }
489 break;
492 double p1x = inputStorage.readDouble();
493 double p1y = inputStorage.readDouble();
494 pos1.set(p1x, p1y);
496 }
497 if (posType == libsumo::POSITION_LON_LAT_ALT) {
498 inputStorage.readDouble();// altitude value is ignored
499 }
501 break;
502 default:
503 server.writeStatusCmd(commandId, libsumo::RTYPE_ERR, "Unknown position format used for distance request");
504 return false;
505 }
506
507 // read position 2
508 posType = inputStorage.readUnsignedByte();
509 switch (posType) {
511 try {
512 std::string roadID = inputStorage.readString();
513 roadPos2.second = inputStorage.readDouble();
514 roadPos2.first = libsumo::Helper::getLaneChecking(roadID, inputStorage.readUnsignedByte(), roadPos2.second);
515 pos2 = roadPos2.first->geometryPositionAtOffset(roadPos2.second);
516 } catch (libsumo::TraCIException& e) {
517 server.writeStatusCmd(commandId, libsumo::RTYPE_ERR, e.what());
518 return false;
519 }
520 break;
523 double p2x = inputStorage.readDouble();
524 double p2y = inputStorage.readDouble();
525 pos2.set(p2x, p2y);
526 }
527 if (posType == libsumo::POSITION_3D) {
528 inputStorage.readDouble();// z value is ignored
529 }
531 break;
534 double p2x = inputStorage.readDouble();
535 double p2y = inputStorage.readDouble();
536 pos2.set(p2x, p2y);
538 }
539 if (posType == libsumo::POSITION_LON_LAT_ALT) {
540 inputStorage.readDouble();// altitude value is ignored
541 }
543 break;
544 default:
545 server.writeStatusCmd(commandId, libsumo::RTYPE_ERR, "Unknown position format used for distance request");
546 return false;
547 }
548
549 // read distance type
550 const int distType = inputStorage.readUnsignedByte();
551
552 double distance = 0.0;
553 if (distType == libsumo::REQUEST_DRIVINGDIST) {
554 distance = libsumo::Helper::getDrivingDistance(roadPos1, roadPos2);
555 } else {
556 // compute air distance (default)
557 distance = pos1.distanceTo(pos2);
558 }
559 // write response command
561 outputStorage.writeDouble(distance);
562 return true;
563}
564
565
566/****************************************************************************/
#define TIME2STEPS(x)
Definition SUMOTime.h:57
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
std::string toHex(const T i, std::streamsize numDigits=0)
Definition ToString.h:56
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
Definition MSLane.h:560
VehicleState
Definition of a vehicle state.
Definition MSNet.h:626
@ ENDING_PARKING
The vehicle ends to park.
@ STARTING_STOP
The vehicles starts to stop.
@ BUILT
The vehicle was built, but has not yet departed.
@ STARTING_PARKING
The vehicles starts to park.
@ STARTING_TELEPORT
The vehicle started to teleport.
@ ENDING_STOP
The vehicle ends to stop.
@ ENDING_TELEPORT
The vehicle ended being teleported.
@ ARRIVED
The vehicle arrived at his destination (is deleted)
@ DEPARTED
The vehicle has departed (was inserted into the network)
@ COLLISION
The vehicle is involved in a collision.
@ EMERGENCYSTOP
The vehicle had to brake harder than permitted.
@ MANEUVERING
Vehicle maneuvering either entering or exiting a parking space.
TransportableState
Definition of a transportable state.
Definition MSNet.h:703
@ PERSON_DEPARTED
The transportable person has departed (was inserted into the network)
@ PERSON_ARRIVED
The transportable person arrived at his destination (is deleted)
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
void set(double x, double y)
set positions x and y
Definition Position.h:82
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
Definition Position.h:263
double x() const
Returns the x-position.
Definition Position.h:52
double z() const
Returns the z-position.
Definition Position.h:62
double y() const
Returns the y-position.
Definition Position.h:57
static bool commandPositionConversion(TraCIServer &server, tcpip::Storage &inputStorage, const int compoundSize, tcpip::Storage &outputStorage, const int commandId)
static bool commandDistanceRequest(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId)
static void writeTransportableStateIDs(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::TransportableState state)
static void writeTransportableStateNumber(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::TransportableState state)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xcb: Set Simulation Variable)
static void writeVehicleStateIDs(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
static void writeVehicleStateNumber(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xab: Get Simulation Variable)
TraCI server used to control sumo by a remote TraCI client.
Definition TraCIServer.h:59
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
void stateLoaded(SUMOTime targetTime)
updates myTargetTime and resets vehicle state changes after loading a simulation state
tcpip::Storage & getWrapperStorage()
void initWrapper(const int domainID, const int variable, const std::string &objID)
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
static TraCIServer * getInstance()
Definition TraCIServer.h:68
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
const std::map< MSNet::VehicleState, std::vector< std::string > > & getVehicleStateChanges() const
const std::map< MSNet::TransportableState, std::vector< std::string > > & getTransportableStateChanges() const
static double getDrivingDistance(std::pair< const MSLane *, double > &roadPos1, std::pair< const MSLane *, double > &roadPos2)
Definition Helper.cpp:472
static std::pair< MSLane *, double > convertCartesianToRoadMap(const Position &pos, const SUMOVehicleClass vClass)
Definition Helper.cpp:436
static const MSLane * getLaneChecking(const std::string &edgeID, int laneIndex, double pos)
Definition Helper.cpp:419
static int readTypedUnsignedByte(tcpip::Storage &ret, const std::string &error="")
static int readCompound(tcpip::Storage &ret, int expectedSize=-1, const std::string &error="")
static void writeStage(tcpip::Storage &content, const libsumo::TraCIStage &stage)
static int readTypedInt(tcpip::Storage &ret, const std::string &error="")
static std::string readTypedString(tcpip::Storage &ret, const std::string &error="")
static double readTypedDouble(tcpip::Storage &ret, const std::string &error="")
An error which allows to continue.
Definition TraCIDefs.h:145
virtual std::string readString()
Definition storage.cpp:180
virtual void writeString(const std::string &s)
Definition storage.cpp:197
virtual void writeInt(int)
Definition storage.cpp:321
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 void writeByte(int)
Definition storage.cpp:140
virtual double readDouble()
Definition storage.cpp:362
virtual int readInt()
Definition storage.cpp:311
TRACI_CONST double INVALID_DOUBLE_VALUE
TRACI_CONST int CMD_SAVE_SIMSTATE
TRACI_CONST int VAR_STOP_ENDING_VEHICLES_IDS
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 TYPE_COMPOUND
TRACI_CONST int VAR_PARKING_MANEUVERING_VEHICLES_IDS
TRACI_CONST int FIND_INTERMODAL_ROUTE
TRACI_CONST int VAR_DEPARTED_PERSONS_NUMBER
TRACI_CONST int VAR_PARKING_MANEUVERING_VEHICLES_NUMBER
TRACI_CONST int POSITION_2D
TRACI_CONST int VAR_ARRIVED_PERSONS_IDS
TRACI_CONST int TYPE_POLYGON
TRACI_CONST int VAR_NET_BOUNDING_BOX
TRACI_CONST int TYPE_STRINGLIST
TRACI_CONST int CMD_SET_SIM_VARIABLE
TRACI_CONST int TYPE_INTEGER
TRACI_CONST int POSITION_LON_LAT
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_IDS
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int VAR_DEPARTED_VEHICLES_IDS
TRACI_CONST int VAR_TELEPORT_ENDING_VEHICLES_NUMBER
TRACI_CONST int CMD_GET_SIM_VARIABLE
TRACI_CONST int CMD_MESSAGE
TRACI_CONST int VAR_PARKING_ENDING_VEHICLES_NUMBER
TRACI_CONST int VAR_LOADED_VEHICLES_IDS
TRACI_CONST int REQUEST_DRIVINGDIST
TRACI_CONST int VAR_DEPARTED_PERSONS_IDS
TRACI_CONST int VAR_ARRIVED_PERSONS_NUMBER
TRACI_CONST int RESPONSE_GET_SIM_VARIABLE
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 TYPE_DOUBLE
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 RTYPE_ERR
TRACI_CONST int VAR_ARRIVED_VEHICLES_IDS
TRACI_CONST int RTYPE_OK
TRACI_CONST int VAR_PARKING_STARTING_VEHICLES_NUMBER
TRACI_CONST int POSITION_LON_LAT_ALT
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER
TRACI_CONST int TYPE_STRING
A list of positions.
Definition TraCIDefs.h:240
std::vector< TraCIPosition > value
Definition TraCIDefs.h:250