Eclipse SUMO - Simulation of Urban MObility
TraCIServerAPI_Person.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 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 /****************************************************************************/
18 // APIs for getting/setting person values via TraCI
19 /****************************************************************************/
20 #include <config.h>
21 
26 #include <microsim/MSNet.h>
27 #include <microsim/MSEdge.h>
28 #include <libsumo/Person.h>
29 #include <libsumo/TraCIConstants.h>
30 #include <libsumo/VehicleType.h>
31 #include "TraCIServer.h"
33 #include "TraCIServerAPI_Person.h"
35 
36 
37 // ===========================================================================
38 // method definitions
39 // ===========================================================================
40 bool
42  tcpip::Storage& outputStorage) {
43  const int variable = inputStorage.readUnsignedByte();
44  const std::string id = inputStorage.readString();
46  try {
47  // in case of SPLIT_TAXI_RESERVATIONS id is a reservation id and handleVariable would throw an "unknown person" error
48  if (variable == libsumo::SPLIT_TAXI_RESERVATIONS || !libsumo::Person::handleVariable(id, variable, &server, &inputStorage)) {
49  switch (variable) {
50  case libsumo::VAR_EDGES: {
51  int nextStageIndex = 0;
52  if (!server.readTypeCheckingInt(inputStorage, nextStageIndex)) {
53  return server.writeErrorStatusCmd(libsumo::CMD_GET_PERSON_VARIABLE, "The message must contain the stage index.", outputStorage);
54  }
56  server.getWrapperStorage().writeStringList(libsumo::Person::getEdges(id, nextStageIndex));
57  break;
58  }
59  case libsumo::VAR_STAGE: {
60  int nextStageIndex = 0;
61  if (!server.readTypeCheckingInt(inputStorage, nextStageIndex)) {
62  return server.writeErrorStatusCmd(libsumo::CMD_GET_PERSON_VARIABLE, "The message must contain the stage index.", outputStorage);
63  }
64  TraCIServerAPI_Simulation::writeStage(server.getWrapperStorage(), libsumo::Person::getStage(id, nextStageIndex));
65  break;
66  }
68  int onlyNew = 0;
69  if (!server.readTypeCheckingInt(inputStorage, onlyNew)) {
70  return server.writeErrorStatusCmd(libsumo::CMD_GET_PERSON_VARIABLE, "Retrieval of reservations requires an integer flag.", outputStorage);
71  }
72  const std::vector<libsumo::TraCIReservation> result = libsumo::Person::getTaxiReservations(onlyNew);
74  server.getWrapperStorage().writeInt((int)result.size());
75  for (const libsumo::TraCIReservation& r : result) {
77  server.getWrapperStorage().writeInt(10);
79  server.getWrapperStorage().writeString(r.id);
81  server.getWrapperStorage().writeStringList(r.persons);
83  server.getWrapperStorage().writeString(r.group);
85  server.getWrapperStorage().writeString(r.fromEdge);
87  server.getWrapperStorage().writeString(r.toEdge);
89  server.getWrapperStorage().writeDouble(r.departPos);
91  server.getWrapperStorage().writeDouble(r.arrivalPos);
93  server.getWrapperStorage().writeDouble(r.depart);
95  server.getWrapperStorage().writeDouble(r.reservationTime);
97  server.getWrapperStorage().writeInt(r.state);
98  }
99  break;
100  }
102  std::vector<std::string> persons;
103  if (!server.readTypeCheckingStringList(inputStorage, persons)) {
104  return server.writeErrorStatusCmd(libsumo::CMD_GET_PERSON_VARIABLE, "Splitting of reservations requires an string list.", outputStorage);
105  }
106  std::string splitID = libsumo::Person::splitTaxiReservation(id, persons);
108  server.getWrapperStorage().writeString(splitID);
109  break;
110  }
111  default:
112  return server.writeErrorStatusCmd(libsumo::CMD_GET_PERSON_VARIABLE, "Get Person Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
113  }
114  }
115  } catch (libsumo::TraCIException& e) {
116  return server.writeErrorStatusCmd(libsumo::CMD_GET_PERSON_VARIABLE, e.what(), outputStorage);
117  }
119  server.writeResponseWithLength(outputStorage, server.getWrapperStorage());
120  return true;
121 }
122 
123 
124 bool
126  tcpip::Storage& outputStorage) {
127  std::string warning = ""; // additional description for response
128  // variable
129  int variable = inputStorage.readUnsignedByte();
130  if (variable != libsumo::VAR_PARAMETER
131  && variable != libsumo::ADD
132  && variable != libsumo::REMOVE
133  && variable != libsumo::APPEND_STAGE
134  && variable != libsumo::REPLACE_STAGE
135  && variable != libsumo::REMOVE_STAGE
136  && variable != libsumo::CMD_REROUTE_TRAVELTIME
137  && variable != libsumo::MOVE_TO_XY
138  && variable != libsumo::VAR_SPEED
139  && variable != libsumo::VAR_TYPE
140  && variable != libsumo::VAR_SPEED_FACTOR
141  && variable != libsumo::VAR_LENGTH
142  && variable != libsumo::VAR_WIDTH
143  && variable != libsumo::VAR_HEIGHT
144  && variable != libsumo::VAR_MINGAP
145  && variable != libsumo::VAR_COLOR
146  ) {
147  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Change Person State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage);
148  }
149 
150  try {
151  // TODO: remove declaration of c after completion
153  // id
154  std::string id = inputStorage.readString();
155  // TODO: remove declaration of p after completion
156  const bool shouldExist = variable != libsumo::ADD;
157  MSTransportable* p = c.get(id);
158  if (p == nullptr && shouldExist) {
159  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Person '" + id + "' is not known", outputStorage);
160  }
161  // process
162  switch (variable) {
163  case libsumo::VAR_SPEED: {
164  double speed = 0;
165  if (!server.readTypeCheckingDouble(inputStorage, speed)) {
166  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Setting speed requires a double.", outputStorage);
167  }
168  // set the speed for all (walking) stages
169  libsumo::Person::setSpeed(id, speed);
170  // modify the vType so that stages added later are also affected
171  TraCIServerAPI_VehicleType::setVariable(libsumo::CMD_SET_VEHICLE_VARIABLE, variable, p->getSingularType().getID(), server, inputStorage, outputStorage);
172  }
173  break;
174  case libsumo::VAR_TYPE: {
175  std::string vTypeID;
176  if (!server.readTypeCheckingString(inputStorage, vTypeID)) {
177  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "The vehicle type id must be given as a string.", outputStorage);
178  }
179  libsumo::Person::setType(id, vTypeID);
180  break;
181  }
183  double speedfactor = 0;
184  if (!server.readTypeCheckingDouble(inputStorage, speedfactor)) {
185  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Setting SpeedFactor requires a double.", outputStorage);
186  }
187  libsumo::Person::setSpeedFactor(id, speedfactor);
188  }
189  break;
190  case libsumo::VAR_COLOR: {
192  if (!server.readTypeCheckingColor(inputStorage, col)) {
193  return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "The color must be given using the according type.", outputStorage);
194  }
195  libsumo::Person::setColor(id, col);
196  break;
197  }
198  case libsumo::ADD: {
199  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
200  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Adding a person requires a compound object.", outputStorage);
201  }
202  if (inputStorage.readInt() != 4) {
203  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Adding a person needs four parameters.", outputStorage);
204  }
205  std::string vTypeID;
206  if (!server.readTypeCheckingString(inputStorage, vTypeID)) {
207  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "First parameter (type) requires a string.", outputStorage);
208  }
209  std::string edgeID;
210  if (!server.readTypeCheckingString(inputStorage, edgeID)) {
211  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Second parameter (edge) requires a string.", outputStorage);
212  }
213  double depart;
214  if (!server.readTypeCheckingDouble(inputStorage, depart)) {
215  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Third parameter (depart) requires a double.", outputStorage);
216  }
217  double pos;
218  if (!server.readTypeCheckingDouble(inputStorage, pos)) {
219  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Fourth parameter (position) requires a double.", outputStorage);
220  }
221  libsumo::Person::add(id, edgeID, pos, depart, vTypeID);
222  }
223  break;
224  case libsumo::REMOVE: {
225  int why = 0;
226  if (!server.readTypeCheckingByte(inputStorage, why)) {
227  return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Removing a person requires a byte.", outputStorage);
228  }
229  libsumo::Person::remove(id, (char)why);
230  }
231  break;
232  case libsumo::APPEND_STAGE: {
233  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
234  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Adding a person stage requires a compound object.", outputStorage);
235  }
236  int numParameters = inputStorage.readInt();
237  if (numParameters == 13) {
238  libsumo::Person::appendStage(id, *TraCIServerAPI_Simulation::readStage(server, inputStorage));
239  } else {
240  int stageType;
241  if (!server.readTypeCheckingInt(inputStorage, stageType)) {
242  return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "The first parameter for adding a stage must be the stage type given as int.", outputStorage);
243  }
244  if (stageType == libsumo::STAGE_DRIVING) {
245  // append driving stage
246  if (numParameters != 4) {
247  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Adding a driving stage needs four parameters.", outputStorage);
248  }
249  std::string edgeID;
250  if (!server.readTypeCheckingString(inputStorage, edgeID)) {
251  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Second parameter (edge) requires a string.", outputStorage);
252  }
253  std::string lines;
254  if (!server.readTypeCheckingString(inputStorage, lines)) {
255  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Third parameter (lines) requires a string.", outputStorage);
256  }
257  std::string stopID;
258  if (!server.readTypeCheckingString(inputStorage, stopID)) {
259  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Fourth parameter (stopID) requires a string.", outputStorage);
260  }
261  libsumo::Person::appendDrivingStage(id, edgeID, lines, stopID);
262  } else if (stageType == libsumo::STAGE_WAITING) {
263  // append waiting stage
264  if (numParameters != 4) {
265  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Adding a waiting stage needs four parameters.", outputStorage);
266  }
267  double duration;
268  if (!server.readTypeCheckingDouble(inputStorage, duration)) {
269  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Second parameter (duration) requires a double.", outputStorage);
270  }
271  std::string description;
272  if (!server.readTypeCheckingString(inputStorage, description)) {
273  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Third parameter (description) requires a string.", outputStorage);
274  }
275  std::string stopID;
276  if (!server.readTypeCheckingString(inputStorage, stopID)) {
277  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Fourth parameter (stopID) requires a string.", outputStorage);
278  }
279  libsumo::Person::appendWaitingStage(id, duration, description, stopID);
280  } else if (stageType == libsumo::STAGE_WALKING) {
281  // append walking stage
282  if (numParameters != 6) {
283  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Adding a walking stage needs six parameters.", outputStorage);
284  }
285  std::vector<std::string> edgeIDs;
286  if (!server.readTypeCheckingStringList(inputStorage, edgeIDs)) {
287  return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Second parameter (edges) route must be defined as a list of edge ids.", outputStorage);
288  }
289  double arrivalPos;
290  if (!server.readTypeCheckingDouble(inputStorage, arrivalPos)) {
291  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Third parameter (arrivalPos) requires a double.", outputStorage);
292  }
293  double duration;
294  if (!server.readTypeCheckingDouble(inputStorage, duration)) {
295  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Fourth parameter (duration) requires a double.", outputStorage);
296  }
297  double speed;
298  if (!server.readTypeCheckingDouble(inputStorage, speed)) {
299  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Fifth parameter (speed) requires a double.", outputStorage);
300  }
301  std::string stopID;
302  if (!server.readTypeCheckingString(inputStorage, stopID)) {
303  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Fourth parameter (stopID) requires a string.", outputStorage);
304  }
305  libsumo::Person::appendWalkingStage(id, edgeIDs, arrivalPos, duration, speed, stopID);
306  } else {
307  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Invalid stage type for person '" + id + "'", outputStorage);
308  }
309  }
310 
311  }
312  break;
313 
314  case libsumo::REPLACE_STAGE : {
315  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
316  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Replacing a person stage requires a compound object.", outputStorage);
317  }
318  if (inputStorage.readInt() != 2) {
319  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Replacing a person stage requires a compound object of size 2.", outputStorage);
320  }
321  int nextStageIndex = 0;
322  if (!server.readTypeCheckingInt(inputStorage, nextStageIndex)) {
323  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "First parameter of replace stage should be an integer", outputStorage);
324  }
325  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
326  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Second parameter of replace stage should be a compound object", outputStorage);
327  }
328  if (inputStorage.readInt() != 13) {
329  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Second parameter of replace stage should be a compound object of size 13", outputStorage);
330  }
331  libsumo::Person::replaceStage(id, nextStageIndex, *TraCIServerAPI_Simulation::readStage(server, inputStorage));
332  }
333  break;
334 
335  case libsumo::REMOVE_STAGE: {
336  int nextStageIndex = 0;
337  if (!server.readTypeCheckingInt(inputStorage, nextStageIndex)) {
338  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "The message must contain the stage index.", outputStorage);
339  }
340  libsumo::Person::removeStage(id, nextStageIndex);
341  }
342  break;
344  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
345  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Rerouting requires a compound object.", outputStorage);
346  }
347  if (inputStorage.readInt() != 0) {
348  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "Rerouting should obtain an empty compound object.", outputStorage);
349  }
350  libsumo::Person::rerouteTraveltime(id);
351  }
352  break;
353  case libsumo::MOVE_TO_XY: {
354  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
355  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "MoveToXY person requires a compound object.", outputStorage);
356  }
357  const int numArgs = inputStorage.readInt();
358  if (numArgs != 5 && numArgs != 6) {
359  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "MoveToXY person should obtain: edgeID, x, y, angle, keepRouteFlag and optionally matchThreshold.", outputStorage);
360  }
361  // edge ID
362  std::string edgeID;
363  if (!server.readTypeCheckingString(inputStorage, edgeID)) {
364  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "The first parameter for moveToXY must be the edge ID given as a string.", outputStorage);
365  }
366  // x
367  double x = 0;
368  if (!server.readTypeCheckingDouble(inputStorage, x)) {
369  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "The second parameter for moveToXY must be the x-position given as a double.", outputStorage);
370  }
371  // y
372  double y = 0;
373  if (!server.readTypeCheckingDouble(inputStorage, y)) {
374  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "The third parameter for moveToXY must be the y-position given as a double.", outputStorage);
375  }
376  // angle
377  double angle = 0;
378  if (!server.readTypeCheckingDouble(inputStorage, angle)) {
379  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "The fourth parameter for moveToXY must be the angle given as a double.", outputStorage);
380  }
381  int keepRouteFlag = 1;
382  if (!server.readTypeCheckingByte(inputStorage, keepRouteFlag)) {
383  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "The fifth parameter for moveToXY must be the keepRouteFlag given as a byte.", outputStorage);
384  }
385  double matchThreshold = 100;
386  if (numArgs == 6) {
387  if (!server.readTypeCheckingDouble(inputStorage, matchThreshold)) {
388  return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "The sixth parameter for moveToXY must be the matchThreshold given as a double.", outputStorage);
389  }
390  }
391  libsumo::Person::moveToXY(id, edgeID, x, y, angle, keepRouteFlag, matchThreshold);
392  }
393  break;
394  case libsumo::VAR_PARAMETER: {
395  if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) {
396  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage);
397  }
398  //read itemNo
399  inputStorage.readInt();
400  std::string name;
401  if (!server.readTypeCheckingString(inputStorage, name)) {
402  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "The name of the parameter must be given as a string.", outputStorage);
403  }
404  std::string value;
405  if (!server.readTypeCheckingString(inputStorage, value)) {
406  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, "The value of the parameter must be given as a string.", outputStorage);
407  }
408  libsumo::Person::setParameter(id, name, value);
409  }
410  break;
411  default:
412  try {
413  if (!TraCIServerAPI_VehicleType::setVariable(libsumo::CMD_SET_PERSON_VARIABLE, variable, p->getSingularType().getID(), server, inputStorage, outputStorage)) {
414  return false;
415  }
416  } catch (ProcessError& e) {
417  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, e.what(), outputStorage);
418  }
419  break;
420  }
421  } catch (libsumo::TraCIException& e) {
422  return server.writeErrorStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, e.what(), outputStorage);
423  }
424  server.writeStatusCmd(libsumo::CMD_SET_PERSON_VARIABLE, libsumo::RTYPE_OK, warning, outputStorage);
425  return true;
426 }
427 
428 
429 /****************************************************************************/
std::string toHex(const T i, std::streamsize numDigits=0)
Definition: ToString.h:56
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:174
virtual MSTransportableControl & getPersonControl()
Returns the person control.
Definition: MSNet.cpp:1059
MSTransportable * get(const std::string &id) const
Returns the named transportable, if existing.
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:90
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xae: Get Person Variable)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xce: Change Person State)
static libsumo::TraCIStage * readStage(TraCIServer &server, tcpip::Storage &inputStorage)
static void writeStage(tcpip::Storage &outputStorage, const libsumo::TraCIStage &stage)
static bool setVariable(const int cmd, const int variable, const std::string &id, TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value for the given type.
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.
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
bool readTypeCheckingByte(tcpip::Storage &inputStorage, int &into)
Reads the value type and a byte, verifying the type.
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.
bool readTypeCheckingInt(tcpip::Storage &inputStorage, int &into)
Reads the value type and an int, verifying the type.
bool readTypeCheckingStringList(tcpip::Storage &inputStorage, std::vector< std::string > &into)
Reads the value type and a string list, verifying the type.
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
bool readTypeCheckingColor(tcpip::Storage &inputStorage, libsumo::TraCIColor &into)
Reads the value type and a color, verifying the type.
An error which allows to continue.
Definition: TraCIDefs.h:130
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 int readInt()
Definition: storage.cpp:311
TRACI_CONST int VAR_EDGES
TRACI_CONST int VAR_TYPE
TRACI_CONST int VAR_MINGAP
TRACI_CONST int REPLACE_STAGE
TRACI_CONST int VAR_TAXI_RESERVATIONS
TRACI_CONST int VAR_SPEED_FACTOR
TRACI_CONST int MOVE_TO_XY
TRACI_CONST int TYPE_COMPOUND
TRACI_CONST int CMD_GET_PERSON_VARIABLE
TRACI_CONST int VAR_STAGE
TRACI_CONST int VAR_COLOR
TRACI_CONST int VAR_WIDTH
TRACI_CONST int STAGE_WAITING
TRACI_CONST int CMD_REROUTE_TRAVELTIME
TRACI_CONST int TYPE_STRINGLIST
TRACI_CONST int APPEND_STAGE
TRACI_CONST int TYPE_INTEGER
TRACI_CONST int CMD_SET_VEHICLE_VARIABLE
TRACI_CONST int VAR_LENGTH
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int REMOVE
TRACI_CONST int CMD_SET_PERSON_VARIABLE
TRACI_CONST int VAR_HEIGHT
TRACI_CONST int RESPONSE_GET_PERSON_VARIABLE
TRACI_CONST int STAGE_WALKING
TRACI_CONST int REMOVE_STAGE
TRACI_CONST int VAR_SPEED
TRACI_CONST int TYPE_DOUBLE
TRACI_CONST int STAGE_DRIVING
TRACI_CONST int RTYPE_OK
TRACI_CONST int ADD
TRACI_CONST int SPLIT_TAXI_RESERVATIONS
TRACI_CONST int TYPE_STRING