Eclipse SUMO - Simulation of Urban MObility
libtraci/Vehicle.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2017-2020 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 <sstream>
23 
24 #define LIBTRACI 1
25 #include <libsumo/Vehicle.h>
26 #include "Connection.h"
27 #include "Domain.h"
28 
29 // TODO remove the following line once the implementation is mature
30 #ifdef _MSC_VER
31 #pragma warning(disable: 4100)
32 #else
33 #pragma GCC diagnostic ignored "-Wunused-parameter"
34 #endif
35 
36 namespace libtraci {
37 
38 typedef Domain<libsumo::CMD_GET_VEHICLE_VARIABLE, libsumo::CMD_SET_VEHICLE_VARIABLE> Dom;
39 
40 
41 // ===========================================================================
42 // static member definitions
43 // ===========================================================================
44 std::vector<std::string>
45 Vehicle::getIDList() {
47 }
48 
49 
50 int
51 Vehicle::getIDCount() {
52  return Dom::getInt(libsumo::ID_COUNT, "");
53 }
54 
55 
58 
59 double
60 Vehicle::getSpeed(const std::string& vehicleID) {
61  return Dom::getDouble(libsumo::VAR_SPEED, vehicleID);
62 }
63 
64 double
65 Vehicle::getLateralSpeed(const std::string& vehicleID) {
66  return Dom::getDouble(libsumo::VAR_SPEED_LAT, vehicleID);
67 }
68 
69 double
70 Vehicle::getAcceleration(const std::string& vehicleID) {
71  return Dom::getDouble(libsumo::VAR_ACCELERATION, vehicleID);
72 }
73 
74 
75 double
76 Vehicle::getSpeedWithoutTraCI(const std::string& vehicleID) {
78 }
79 
80 
82 Vehicle::getPosition(const std::string& vehicleID, const bool includeZ) {
83  return includeZ ? getPosition3D(vehicleID) : Dom::getPos(libsumo::VAR_POSITION, vehicleID);
84 }
85 
86 
88 Vehicle::getPosition3D(const std::string& vehicleID) {
89  return Dom::getPos3D(libsumo::VAR_POSITION3D, vehicleID);
90 }
91 
92 
93 double
94 Vehicle::getAngle(const std::string& vehicleID) {
95  return Dom::getDouble(libsumo::VAR_ANGLE, vehicleID);
96 }
97 
98 
99 double
100 Vehicle::getSlope(const std::string& vehicleID) {
101  return Dom::getDouble(libsumo::VAR_SLOPE, vehicleID);
102 }
103 
104 
105 std::string
106 Vehicle::getRoadID(const std::string& vehicleID) {
107  return Dom::getString(libsumo::VAR_ROAD_ID, vehicleID);
108 }
109 
110 
111 std::string
112 Vehicle::getLaneID(const std::string& vehicleID) {
113  return Dom::getString(libsumo::VAR_LANE_ID, vehicleID);
114 }
115 
116 
117 int
118 Vehicle::getLaneIndex(const std::string& vehicleID) {
119  return Dom::getInt(libsumo::VAR_LANE_INDEX, vehicleID);
120 }
121 
122 
123 std::string
124 Vehicle::getTypeID(const std::string& vehicleID) {
125  return Dom::getString(libsumo::VAR_TYPE, vehicleID);
126 }
127 
128 
129 std::string
130 Vehicle::getRouteID(const std::string& vehicleID) {
131  return Dom::getString(libsumo::VAR_ROUTE_ID, vehicleID);
132 }
133 
134 
135 int
136 Vehicle::getRouteIndex(const std::string& vehicleID) {
137  return Dom::getInt(libsumo::VAR_ROUTE_INDEX, vehicleID);
138 }
139 
140 
142 Vehicle::getColor(const std::string& vehicleID) {
143  return Dom::getCol(libsumo::VAR_COLOR, vehicleID);
144 }
145 
146 double
147 Vehicle::getLanePosition(const std::string& vehicleID) {
148  return Dom::getDouble(libsumo::VAR_LANEPOSITION, vehicleID);
149 }
150 
151 double
152 Vehicle::getLateralLanePosition(const std::string& vehicleID) {
154 }
155 
156 double
157 Vehicle::getCO2Emission(const std::string& vehicleID) {
158  return Dom::getDouble(libsumo::VAR_CO2EMISSION, vehicleID);
159 }
160 
161 double
162 Vehicle::getCOEmission(const std::string& vehicleID) {
163  return Dom::getDouble(libsumo::VAR_COEMISSION, vehicleID);
164 }
165 
166 double
167 Vehicle::getHCEmission(const std::string& vehicleID) {
168  return Dom::getDouble(libsumo::VAR_HCEMISSION, vehicleID);
169 }
170 
171 double
172 Vehicle::getPMxEmission(const std::string& vehicleID) {
173  return Dom::getDouble(libsumo::VAR_PMXEMISSION, vehicleID);
174 }
175 
176 double
177 Vehicle::getNOxEmission(const std::string& vehicleID) {
178  return Dom::getDouble(libsumo::VAR_NOXEMISSION, vehicleID);
179 }
180 
181 double
182 Vehicle::getFuelConsumption(const std::string& vehicleID) {
183  return Dom::getDouble(libsumo::VAR_FUELCONSUMPTION, vehicleID);
184 }
185 
186 double
187 Vehicle::getNoiseEmission(const std::string& vehicleID) {
188  return Dom::getDouble(libsumo::VAR_NOISEEMISSION, vehicleID);
189 }
190 
191 double
192 Vehicle::getElectricityConsumption(const std::string& vehicleID) {
194 }
195 
196 int
197 Vehicle::getPersonNumber(const std::string& vehicleID) {
198  return Dom::getInt(libsumo::VAR_PERSON_NUMBER, vehicleID);
199 }
200 
201 int
202 Vehicle::getPersonCapacity(const std::string& vehicleID) {
203  return Dom::getInt(libsumo::VAR_PERSON_CAPACITY, vehicleID);
204 }
205 
206 std::vector<std::string>
207 Vehicle::getPersonIDList(const std::string& vehicleID) {
209 }
210 
211 std::pair<std::string, double>
212 Vehicle::getLeader(const std::string& vehicleID, double dist) {
213  tcpip::Storage content;
215  content.writeDouble(dist);
218  ret.readInt(); // components
219  ret.readUnsignedByte();
220  const std::string leaderID = ret.readString();
221  ret.readUnsignedByte();
222  const double gap = ret.readDouble();
223  return std::make_pair(leaderID, gap);
224  }
225  return std::make_pair("", libsumo::INVALID_DOUBLE_VALUE);
226 }
227 
228 
229 std::pair<std::string, double>
230 Vehicle::getFollower(const std::string& vehicleID, double dist) {
231  tcpip::Storage content;
233  content.writeDouble(dist);
236  ret.readInt(); // components
237  ret.readUnsignedByte();
238  const std::string leaderID = ret.readString();
239  ret.readUnsignedByte();
240  const double gap = ret.readDouble();
241  return std::make_pair(leaderID, gap);
242  }
243  return std::make_pair("", libsumo::INVALID_DOUBLE_VALUE);
244 }
245 
246 
247 double
248 Vehicle::getWaitingTime(const std::string& vehicleID) {
249  return Dom::getDouble(libsumo::VAR_WAITING_TIME, vehicleID);
250 }
251 
252 
253 double
254 Vehicle::getAccumulatedWaitingTime(const std::string& vehicleID) {
256 }
257 
258 
259 double
260 Vehicle::getAdaptedTraveltime(const std::string& vehicleID, double time, const std::string& edgeID) {
261  tcpip::Storage content;
263  content.writeInt(2);
265  content.writeDouble(time);
267  content.writeString(edgeID);
268  return Dom::getDouble(libsumo::VAR_EDGE_TRAVELTIME, vehicleID, &content);
269 }
270 
271 
272 double
273 Vehicle::getEffort(const std::string& vehicleID, double time, const std::string& edgeID) {
274  tcpip::Storage content;
276  content.writeInt(2);
278  content.writeDouble(time);
280  content.writeString(edgeID);
281  return Dom::getDouble(libsumo::VAR_EDGE_EFFORT, edgeID, &content);
282 }
283 
284 
285 bool
286 Vehicle::isRouteValid(const std::string& vehicleID) {
287  return Dom::getInt(libsumo::VAR_ROUTE_VALID, vehicleID) != 0;
288 }
289 
290 
291 std::vector<std::string>
292 Vehicle::getRoute(const std::string& vehicleID) {
293  return Dom::getStringVector(libsumo::VAR_ROUTE, vehicleID);
294 }
295 
296 
297 int
298 Vehicle::getSignals(const std::string& vehicleID) {
299  return Dom::getInt(libsumo::VAR_SIGNALS, vehicleID) != 0;
300 }
301 
302 
303 std::vector<libsumo::TraCIBestLanesData>
304 Vehicle::getBestLanes(const std::string& vehicleID) {
305  std::vector<libsumo::TraCIBestLanesData> result;
308  ret.readInt();
309  ret.readUnsignedByte();
310 
311  const int n = ret.readInt(); // number of following edge information
312  for (int i = 0; i < n; ++i) {
314  ret.readUnsignedByte();
315  info.laneID = ret.readString();
316 
317  ret.readUnsignedByte();
318  info.length = ret.readDouble();
319 
320  ret.readUnsignedByte();
321  info.occupation = ret.readDouble();
322 
323  ret.readUnsignedByte();
324  info.bestLaneOffset = ret.readByte();
325 
326  ret.readUnsignedByte();
327  info.allowsContinuation = (ret.readUnsignedByte() == 1);
328 
329  ret.readUnsignedByte();
330  const int m = ret.readInt();
331  for (int i = 0; i < m; ++i) {
332  info.continuationLanes.push_back(ret.readString());
333  }
334  result.push_back(info);
335  }
336  }
337  return result;
338 }
339 
340 
341 std::vector<libsumo::TraCINextTLSData>
342 Vehicle::getNextTLS(const std::string& vehicleID) {
343  std::vector<libsumo::TraCINextTLSData> result;
346  ret.readInt(); // components
347  // number of items
348  ret.readUnsignedByte();
349  const int n = ret.readInt();
350  for (int i = 0; i < n; ++i) {
352  ret.readUnsignedByte();
353  d.id = ret.readString();
354 
355  ret.readUnsignedByte();
356  d.tlIndex = ret.readInt();
357 
358  ret.readUnsignedByte();
359  d.dist = ret.readDouble();
360 
361  ret.readUnsignedByte();
362  d.state = (char)ret.readByte();
363 
364  result.push_back(d);
365  }
366  }
367  return result;
368 }
369 
370 std::vector<libsumo::TraCINextStopData>
371 Vehicle::getNextStops(const std::string& vehicleID) {
372  return getStops(vehicleID, 0);
373 }
374 
375 std::vector<libsumo::TraCINextStopData>
376 Vehicle::getStops(const std::string& vehicleID, int limit) {
377  std::vector<libsumo::TraCINextStopData> result;
380  ret.readInt(); // components
381  // number of items
382  ret.readUnsignedByte();
383  const int n = ret.readInt();
384  for (int i = 0; i < n; ++i) {
386  ret.readUnsignedByte();
387  s.lane = ret.readString();
388 
389  ret.readUnsignedByte();
390  s.endPos = ret.readDouble();
391 
392  ret.readUnsignedByte();
393  s.stoppingPlaceID = ret.readString();
394 
395  ret.readUnsignedByte();
396  s.stopFlags = ret.readInt();
397 
398  ret.readUnsignedByte();
399  s.duration = ret.readDouble();
400 
401  ret.readUnsignedByte();
402  s.until = ret.readDouble();
403 
404  ret.readUnsignedByte();
405  s.startPos = ret.readDouble();
406 
407  ret.readUnsignedByte();
408  s.intendedArrival = ret.readDouble();
409 
410  ret.readUnsignedByte();
411  s.arrival = ret.readDouble();
412 
413  ret.readUnsignedByte();
414  s.depart = ret.readDouble();
415 
416  ret.readUnsignedByte();
417  s.split = ret.readString();
418 
419  ret.readUnsignedByte();
420  s.join = ret.readString();
421 
422  ret.readUnsignedByte();
423  s.actType = ret.readString();
424 
425  ret.readUnsignedByte();
426  s.tripId = ret.readString();
427 
428  ret.readUnsignedByte();
429  s.line = ret.readString();
430 
431  ret.readUnsignedByte();
432  s.speed = ret.readDouble();
433 
434  result.push_back(s);
435  }
436  }
437  return result;
438 }
439 
440 
441 int
442 Vehicle::getStopState(const std::string& vehicleID) {
443  return Dom::getInt(libsumo::VAR_STOPSTATE, vehicleID);
444 }
445 
446 
447 double
448 Vehicle::getDistance(const std::string& vehicleID) {
449  return Dom::getDouble(libsumo::VAR_DISTANCE, vehicleID);
450 }
451 
452 
453 double
454 Vehicle::getDrivingDistance(const std::string& vehicleID, const std::string& edgeID, double position, int /* laneIndex */) {
457 }
458 
459 
460 double
461 Vehicle::getDrivingDistance2D(const std::string& vehicleID, double x, double y) {
464 }
465 
466 
467 double
468 Vehicle::getAllowedSpeed(const std::string& vehicleID) {
469  return Dom::getDouble(libsumo::VAR_ALLOWED_SPEED, vehicleID);
470 }
471 
472 
473 double
474 Vehicle::getSpeedFactor(const std::string& vehicleID) {
475  return Dom::getDouble(libsumo::VAR_SPEED_FACTOR, vehicleID);
476 }
477 
478 
479 int
480 Vehicle::getSpeedMode(const std::string& vehicleID) {
481  return Dom::getInt(libsumo::VAR_SPEEDSETMODE, vehicleID);
482 }
483 
484 
485 int
486 Vehicle::getLaneChangeMode(const std::string& vehicleID) {
487  return Dom::getInt(libsumo::VAR_LANECHANGE_MODE, vehicleID);
488 }
489 
490 
491 int
492 Vehicle::getRoutingMode(const std::string& vehicleID) {
493  return Dom::getInt(libsumo::VAR_ROUTING_MODE, vehicleID);
494 }
495 
496 
497 std::string
498 Vehicle::getLine(const std::string& vehicleID) {
499  return Dom::getString(libsumo::VAR_LINE, vehicleID);
500 }
501 
502 
503 
504 std::vector<std::string>
505 Vehicle::getVia(const std::string& vehicleID) {
506  return Dom::getStringVector(libsumo::VAR_VIA, vehicleID);
507 }
508 
509 
510 std::pair<int, int>
511 Vehicle::getLaneChangeState(const std::string& vehicleID, int direction) {
512  // XXX
513  //tcpip::Storage content;
514  //content.writeByte(libsumo::TYPE_INTEGER);
515  //content.writeInt(direction);
516  //Connection::getActive().doCommand(libsumo::CMD_GET_VEHICLE_VARIABLE, libsumo::CMD_CHANGELANE, vehicleID, &content);
517  //if (Connection::getActive().processGet(libsumo::CMD_GET_VEHICLE_VARIABLE, libsumo::TYPE_COMPOUND)) {
518  // ret.readInt(); // components
519  // ret.readUnsignedByte();
520  // const int stateWithoutTraCI = ret.readInt();
521  // ret.readUnsignedByte();
522  // const int state = ret.readInt();
523  // return std::make_pair(stateWithoutTraCI, state);
524  //}
526 }
527 
528 
529 std::vector<std::pair<std::string, double> >
530 Vehicle::getNeighbors(const std::string& vehicleID, const int mode) {
531  std::vector<std::pair<std::string, double> > neighs;
532  // XXX
533  return neighs;
534 }
535 
536 
537 double
538 Vehicle::getFollowSpeed(const std::string& vehicleID, double speed, double gap, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) {
539  tcpip::Storage content;
541  content.writeInt(5);
543  content.writeDouble(speed);
545  content.writeDouble(gap);
547  content.writeDouble(leaderSpeed);
549  content.writeDouble(leaderMaxDecel);
551  content.writeString(leaderID);
552  return Dom::getDouble(libsumo::VAR_FOLLOW_SPEED, vehicleID, &content);
553 }
554 
555 
556 double
557 Vehicle::getSecureGap(const std::string& vehicleID, double speed, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) {
558  tcpip::Storage content;
560  content.writeInt(4);
562  content.writeDouble(speed);
564  content.writeDouble(leaderSpeed);
566  content.writeDouble(leaderMaxDecel);
568  content.writeString(leaderID);
569  return Dom::getDouble(libsumo::VAR_SECURE_GAP, vehicleID, &content);
570 }
571 
572 
573 double
574 Vehicle::getStopSpeed(const std::string& vehicleID, const double speed, double gap) {
575  tcpip::Storage content;
577  content.writeInt(2);
579  content.writeDouble(speed);
581  content.writeDouble(gap);
582  return Dom::getDouble(libsumo::VAR_STOP_SPEED, vehicleID, &content);
583 }
584 
585 double
586 Vehicle::getStopDelay(const std::string& vehicleID) {
587  return Dom::getDouble(libsumo::VAR_STOP_DELAY, vehicleID);
588 }
589 
590 double
591 Vehicle::getStopArrivalDelay(const std::string& vehicleID) {
593 }
594 
595 std::vector<std::string>
596 Vehicle::getTaxiFleet(int taxiState) {
597  tcpip::Storage content;
599  content.writeInt(1);
601  content.writeInt(taxiState);
602  return Dom::getStringVector(libsumo::VAR_TAXI_FLEET, "", &content);
603 }
604 
605 std::string
606 Vehicle::getEmissionClass(const std::string& vehicleID) {
607  return Dom::getString(libsumo::VAR_EMISSIONCLASS, vehicleID);
608 }
609 
610 std::string
611 Vehicle::getShapeClass(const std::string& vehicleID) {
612  return Dom::getString(libsumo::VAR_SHAPECLASS, vehicleID);
613 }
614 
615 
616 double
617 Vehicle::getLength(const std::string& vehicleID) {
618  return Dom::getDouble(libsumo::VAR_LENGTH, vehicleID);
619 }
620 
621 
622 double
623 Vehicle::getAccel(const std::string& vehicleID) {
624  return Dom::getDouble(libsumo::VAR_ACCEL, vehicleID);
625 }
626 
627 
628 double
629 Vehicle::getDecel(const std::string& vehicleID) {
630  return Dom::getDouble(libsumo::VAR_DECEL, vehicleID);
631 }
632 
633 
634 double Vehicle::getEmergencyDecel(const std::string& vehicleID) {
635  return Dom::getDouble(libsumo::VAR_EMERGENCY_DECEL, vehicleID);
636 }
637 
638 
639 double Vehicle::getApparentDecel(const std::string& vehicleID) {
640  return Dom::getDouble(libsumo::VAR_APPARENT_DECEL, vehicleID);
641 }
642 
643 
644 double Vehicle::getActionStepLength(const std::string& vehicleID) {
646 }
647 
648 
649 double Vehicle::getLastActionTime(const std::string& vehicleID) {
650  return Dom::getDouble(libsumo::VAR_LASTACTIONTIME, vehicleID);
651 }
652 
653 
654 double
655 Vehicle::getTau(const std::string& vehicleID) {
656  return Dom::getDouble(libsumo::VAR_TAU, vehicleID);
657 }
658 
659 
660 double
661 Vehicle::getImperfection(const std::string& vehicleID) {
662  return Dom::getDouble(libsumo::VAR_IMPERFECTION, vehicleID);
663 }
664 
665 
666 double
667 Vehicle::getSpeedDeviation(const std::string& vehicleID) {
668  return Dom::getDouble(libsumo::VAR_SPEED_DEVIATION, vehicleID);
669 }
670 
671 
672 std::string
673 Vehicle::getVehicleClass(const std::string& vehicleID) {
674  return Dom::getString(libsumo::VAR_VEHICLECLASS, vehicleID);
675 }
676 
677 
678 double
679 Vehicle::getMinGap(const std::string& vehicleID) {
680  return Dom::getDouble(libsumo::VAR_MINGAP, vehicleID);
681 }
682 
683 
684 double
685 Vehicle::getMinGapLat(const std::string& vehicleID) {
686  return Dom::getDouble(libsumo::VAR_MINGAP_LAT, vehicleID);
687 }
688 
689 
690 double
691 Vehicle::getMaxSpeed(const std::string& vehicleID) {
692  return Dom::getDouble(libsumo::VAR_MAXSPEED, vehicleID);
693 }
694 
695 
696 double
697 Vehicle::getMaxSpeedLat(const std::string& vehicleID) {
698  return Dom::getDouble(libsumo::VAR_MAXSPEED_LAT, vehicleID);
699 }
700 
701 
702 std::string
703 Vehicle::getLateralAlignment(const std::string& vehicleID) {
704  return Dom::getString(libsumo::VAR_LATALIGNMENT, vehicleID);
705 }
706 
707 
708 double
709 Vehicle::getWidth(const std::string& vehicleID) {
710  return Dom::getDouble(libsumo::VAR_WIDTH, vehicleID);
711 }
712 
713 
714 double
715 Vehicle::getHeight(const std::string& vehicleID) {
716  return Dom::getDouble(libsumo::VAR_HEIGHT, vehicleID);
717 }
718 
719 
720 void
721 Vehicle::setStop(const std::string& vehicleID,
722  const std::string& edgeID,
723  double pos,
724  int laneIndex,
725  double duration,
726  int flags,
727  double startPos,
728  double until) {
729  tcpip::Storage content;
731  content.writeInt(7);
733  content.writeString(edgeID);
735  content.writeDouble(pos);
737  content.writeByte(laneIndex);
739  content.writeDouble(duration);
741  content.writeByte(flags);
743  content.writeDouble(startPos);
745  content.writeDouble(until);
747 }
748 
749 
750 void
751 Vehicle::replaceStop(const std::string& vehicleID,
752  int nextStopIndex,
753  const std::string& edgeID,
754  double pos,
755  int laneIndex,
756  double duration,
757  int flags,
758  double startPos,
759  double until) {
760  tcpip::Storage content;
762  content.writeInt(8);
764  content.writeString(edgeID);
766  content.writeDouble(pos);
768  content.writeByte(laneIndex);
770  content.writeDouble(duration);
772  content.writeByte(flags);
774  content.writeDouble(startPos);
776  content.writeDouble(until);
778  content.writeDouble(nextStopIndex);
780 }
781 
782 
783 void
784 Vehicle::rerouteParkingArea(const std::string& vehicleID, const std::string& parkingAreaID) {
785  Dom::setString(libsumo::CMD_REROUTE_TO_PARKING, vehicleID, parkingAreaID);
786 }
787 
788 void
789 Vehicle::resume(const std::string& vehicleID) {
790  tcpip::Storage content;
792  content.writeInt(0);
794 }
795 
796 
797 void
798 Vehicle::changeTarget(const std::string& vehicleID, const std::string& edgeID) {
799  Dom::setString(libsumo::CMD_CHANGETARGET, vehicleID, edgeID);
800 }
801 
802 
803 void
804 Vehicle::changeLane(const std::string& vehicleID, int laneIndex, double duration) {
805  tcpip::Storage content;
807  content.writeInt(2);
809  content.writeInt(laneIndex);
811  content.writeDouble(duration);
813 }
814 
815 void
816 Vehicle::changeLaneRelative(const std::string& vehicleID, int indexOffset, double duration) {
817  tcpip::Storage content;
819  content.writeInt(3);
821  content.writeInt(indexOffset);
823  content.writeDouble(duration);
825  content.writeDouble(1);
827 }
828 
829 
830 void
831 Vehicle::changeSublane(const std::string& vehicleID, double latDist) {
832  Dom::setDouble(libsumo::CMD_CHANGESUBLANE, vehicleID, latDist);
833 }
834 
835 
836 void
837 Vehicle::add(const std::string& vehicleID,
838  const std::string& routeID,
839  const std::string& typeID,
840  const std::string& depart,
841  const std::string& departLane,
842  const std::string& departPos,
843  const std::string& departSpeed,
844  const std::string& arrivalLane,
845  const std::string& arrivalPos,
846  const std::string& arrivalSpeed,
847  const std::string& fromTaz,
848  const std::string& toTaz,
849  const std::string& line,
850  int personCapacity,
851  int personNumber) {
852  tcpip::Storage content;
854  content.writeInt(14);
856  content.writeString(routeID);
858  content.writeString(typeID);
860  content.writeString(depart);
862  content.writeString(departLane);
864  content.writeString(departPos);
866  content.writeString(departSpeed);
867 
869  content.writeString(arrivalLane);
871  content.writeString(arrivalPos);
873  content.writeString(arrivalSpeed);
874 
876  content.writeString(fromTaz);
878  content.writeString(toTaz);
880  content.writeString(line);
881 
883  content.writeInt(personCapacity);
885  content.writeInt(personNumber);
886 
888 }
889 
890 
891 void
892 Vehicle::moveToXY(const std::string& vehicleID, const std::string& edgeID, const int laneIndex,
893  const double x, const double y, double angle, const int keepRoute) {
894  tcpip::Storage content;
896  content.writeInt(6);
898  content.writeString(edgeID);
900  content.writeInt(laneIndex);
902  content.writeDouble(x);
904  content.writeDouble(y);
906  content.writeDouble(angle);
908  content.writeByte(keepRoute);
910 }
911 
912 void
913 Vehicle::slowDown(const std::string& vehicleID, double speed, double duration) {
914  tcpip::Storage content;
916  content.writeInt(2);
918  content.writeDouble(speed);
920  content.writeDouble(duration);
922 }
923 
924 void
925 Vehicle::openGap(const std::string& vehicleID, double newTimeHeadway, double newSpaceHeadway, double duration, double changeRate, double maxDecel, const std::string& referenceVehID) {
926  tcpip::Storage content;
928  content.writeInt(6);
930  content.writeDouble(newTimeHeadway);
932  content.writeDouble(newSpaceHeadway);
934  content.writeDouble(duration);
936  content.writeDouble(changeRate);
938  content.writeDouble(maxDecel);
940  content.writeString(referenceVehID);
942 }
943 
944 void
945 Vehicle::deactivateGapControl(const std::string& vehicleID) {
946  openGap(vehicleID, -1, -1, -1, -1, -1, "");
947 }
948 
949 void
950 Vehicle::requestToC(const std::string& vehID, double leadTime) {
951  std::ostringstream oss;
952  oss.setf(std::ios::fixed, std::ios::floatfield);
953  oss << std::setprecision(2);
954  oss << leadTime;
955  setParameter(vehID, "device.toc.requestToC", oss.str());
956 }
957 
958 void
959 Vehicle::setSpeed(const std::string& vehicleID, double speed) {
960  Dom::setDouble(libsumo::VAR_SPEED, vehicleID, speed);
961 }
962 
963 void
964 Vehicle::setPreviousSpeed(const std::string& vehicleID, double prevspeed) {
965  Dom::setDouble(libsumo::VAR_PREV_SPEED, vehicleID, prevspeed);
966 }
967 
968 void
969 Vehicle::setSpeedMode(const std::string& vehicleID, int speedMode) {
970  Dom::setInt(libsumo::VAR_SPEEDSETMODE, vehicleID, speedMode);
971 }
972 
973 void
974 Vehicle::setLaneChangeMode(const std::string& vehicleID, int laneChangeMode) {
975  Dom::setInt(libsumo::VAR_LANECHANGE_MODE, vehicleID, laneChangeMode);
976 }
977 
978 void
979 Vehicle::setRoutingMode(const std::string& vehicleID, int routingMode) {
980  Dom::setInt(libsumo::VAR_ROUTING_MODE, vehicleID, routingMode);
981 }
982 
983 void
984 Vehicle::setType(const std::string& vehicleID, const std::string& typeID) {
985  Dom::setString(libsumo::VAR_TYPE, vehicleID, typeID);
986 }
987 
988 void
989 Vehicle::setRouteID(const std::string& vehicleID, const std::string& routeID) {
990  Dom::setString(libsumo::VAR_ROUTE_ID, vehicleID, routeID);
991 }
992 
993 void
994 Vehicle::setRoute(const std::string& vehicleID, const std::string& edgeID) {
995  setRoute(vehicleID, std::vector<std::string>({edgeID}));
996 }
997 
998 void
999 Vehicle::setRoute(const std::string& vehicleID, const std::vector<std::string>& edgeIDs) {
1000  Dom::setStringVector(libsumo::VAR_ROUTE, vehicleID, edgeIDs);
1001 }
1002 
1003 void
1004 Vehicle::updateBestLanes(const std::string& vehicleID) {
1005  // XXX
1006 }
1007 
1008 
1009 void
1010 Vehicle::setAdaptedTraveltime(const std::string& vehicleID, const std::string& edgeID,
1011  double time, double begSeconds, double endSeconds) {
1012  tcpip::Storage content;
1013  if (time == libsumo::INVALID_DOUBLE_VALUE) {
1014  // reset
1016  content.writeInt(1);
1018  content.writeString(edgeID);
1019  } else if (begSeconds == libsumo::INVALID_DOUBLE_VALUE) {
1020  // set value for the whole simulation
1022  content.writeInt(2);
1024  content.writeString(edgeID);
1026  content.writeDouble(time);
1027  } else {
1029  content.writeInt(4);
1031  content.writeDouble(begSeconds);
1033  content.writeDouble(endSeconds);
1035  content.writeString(edgeID);
1037  content.writeDouble(time);
1038  }
1040 }
1041 
1042 
1043 void
1044 Vehicle::setEffort(const std::string& vehicleID, const std::string& edgeID,
1045  double effort, double begSeconds, double endSeconds) {
1046  tcpip::Storage content;
1047  if (effort == libsumo::INVALID_DOUBLE_VALUE) {
1048  // reset
1050  content.writeInt(1);
1052  content.writeString(edgeID);
1053  } else if (begSeconds == libsumo::INVALID_DOUBLE_VALUE) {
1054  // set value for the whole simulation
1056  content.writeInt(2);
1058  content.writeString(edgeID);
1060  content.writeDouble(effort);
1061  } else {
1063  content.writeInt(4);
1065  content.writeDouble(begSeconds);
1067  content.writeDouble(endSeconds);
1069  content.writeString(edgeID);
1071  content.writeDouble(effort);
1072  }
1074 }
1075 
1076 
1077 void
1078 Vehicle::rerouteTraveltime(const std::string& vehicleID, const bool currentTravelTimes) {
1079  // UNUSED_PARAMETER(currentTravelTimes); // !!! see #5943
1080  tcpip::Storage content;
1082  content.writeInt(0);
1084 }
1085 
1086 
1087 void
1088 Vehicle::rerouteEffort(const std::string& vehicleID) {
1089  tcpip::Storage content;
1091  content.writeInt(0);
1093 }
1094 
1095 
1096 void
1097 Vehicle::setSignals(const std::string& vehicleID, int signals) {
1098  Dom::setInt(libsumo::VAR_SIGNALS, vehicleID, signals);
1099 }
1100 
1101 
1102 void
1103 Vehicle::moveTo(const std::string& vehicleID, const std::string& laneID, double position, int reason) {
1104  tcpip::Storage content;
1106  content.writeInt(3);
1108  content.writeString(laneID);
1110  content.writeDouble(position);
1112  content.writeInt(reason);
1114 }
1115 
1116 
1117 void
1118 Vehicle::setActionStepLength(const std::string& vehicleID, double actionStepLength, bool resetActionOffset) {
1119  //if (actionStepLength < 0) {
1120  // raise TraCIException("Invalid value for actionStepLength. Given value must be non-negative.")
1121  //{
1122  // Use negative value to indicate resetActionOffset == False
1123  if (!resetActionOffset) {
1124  actionStepLength *= -1;
1125  }
1126  Dom::setDouble(libsumo::VAR_ACTIONSTEPLENGTH, vehicleID, actionStepLength);
1127 }
1128 
1129 
1130 void
1131 Vehicle::remove(const std::string& vehicleID, char reason) {
1132  tcpip::Storage content;
1134  content.writeUnsignedByte(reason);
1136 }
1137 
1138 
1139 void
1140 Vehicle::setColor(const std::string& vehicleID, const libsumo::TraCIColor& color) {
1141  Dom::setCol(libsumo::VAR_COLOR, vehicleID, color);
1142 }
1143 
1144 
1145 void
1146 Vehicle::setSpeedFactor(const std::string& vehicleID, double factor) {
1147  Dom::setDouble(libsumo::VAR_SPEED_FACTOR, vehicleID, factor);
1148 }
1149 
1150 
1151 void
1152 Vehicle::setLine(const std::string& vehicleID, const std::string& line) {
1153  Dom::setString(libsumo::VAR_LINE, vehicleID, line);
1154 }
1155 
1156 
1157 void
1158 Vehicle::setVia(const std::string& vehicleID, const std::vector<std::string>& via) {
1159  Dom::setStringVector(libsumo::VAR_VIA, vehicleID, via);
1160 }
1161 
1162 
1163 void
1164 Vehicle::setLength(const std::string& vehicleID, double length) {
1165  Dom::setDouble(libsumo::VAR_LENGTH, vehicleID, length);
1166 }
1167 
1168 
1169 void
1170 Vehicle::setMaxSpeed(const std::string& vehicleID, double speed) {
1171  Dom::setDouble(libsumo::VAR_MAXSPEED, vehicleID, speed);
1172 }
1173 
1174 
1175 void
1176 Vehicle::setVehicleClass(const std::string& vehicleID, const std::string& clazz) {
1177  Dom::setString(libsumo::VAR_VEHICLECLASS, vehicleID, clazz);
1178 }
1179 
1180 
1181 void
1182 Vehicle::setShapeClass(const std::string& vehicleID, const std::string& clazz) {
1183  Dom::setString(libsumo::VAR_SHAPECLASS, vehicleID, clazz);
1184 }
1185 
1186 
1187 void
1188 Vehicle::setEmissionClass(const std::string& vehicleID, const std::string& clazz) {
1189  Dom::setString(libsumo::VAR_EMISSIONCLASS, vehicleID, clazz);
1190 }
1191 
1192 
1193 void
1194 Vehicle::setWidth(const std::string& vehicleID, double width) {
1195  Dom::setDouble(libsumo::VAR_WIDTH, vehicleID, width);
1196 }
1197 
1198 
1199 void
1200 Vehicle::setHeight(const std::string& vehicleID, double height) {
1201  Dom::setDouble(libsumo::VAR_HEIGHT, vehicleID, height);
1202 }
1203 
1204 
1205 void
1206 Vehicle::setMinGap(const std::string& vehicleID, double minGap) {
1207  Dom::setDouble(libsumo::VAR_MINGAP, vehicleID, minGap);
1208 }
1209 
1210 
1211 void
1212 Vehicle::setAccel(const std::string& vehicleID, double accel) {
1213  Dom::setDouble(libsumo::VAR_ACCEL, vehicleID, accel);
1214 }
1215 
1216 
1217 void
1218 Vehicle::setDecel(const std::string& vehicleID, double decel) {
1219  Dom::setDouble(libsumo::VAR_DECEL, vehicleID, decel);
1220 }
1221 
1222 
1223 void
1224 Vehicle::setEmergencyDecel(const std::string& vehicleID, double decel) {
1225  Dom::setDouble(libsumo::VAR_EMERGENCY_DECEL, vehicleID, decel);
1226 }
1227 
1228 
1229 void
1230 Vehicle::setApparentDecel(const std::string& vehicleID, double decel) {
1231  Dom::setDouble(libsumo::VAR_APPARENT_DECEL, vehicleID, decel);
1232 }
1233 
1234 
1235 void
1236 Vehicle::setImperfection(const std::string& vehicleID, double imperfection) {
1237  Dom::setDouble(libsumo::VAR_IMPERFECTION, vehicleID, imperfection);
1238 }
1239 
1240 
1241 void
1242 Vehicle::setTau(const std::string& vehicleID, double tau) {
1243  Dom::setDouble(libsumo::VAR_TAU, vehicleID, tau);
1244 }
1245 
1246 
1247 void
1248 Vehicle::setMinGapLat(const std::string& vehicleID, double minGapLat) {
1249  Dom::setDouble(libsumo::VAR_MINGAP_LAT, vehicleID, minGapLat);
1250 }
1251 
1252 
1253 void
1254 Vehicle::setMaxSpeedLat(const std::string& vehicleID, double speed) {
1255  Dom::setDouble(libsumo::VAR_MAXSPEED_LAT, vehicleID, speed);
1256 }
1257 
1258 
1259 void
1260 Vehicle::setLateralAlignment(const std::string& vehicleID, const std::string& latAlignment) {
1261  Dom::setString(libsumo::VAR_LATALIGNMENT, vehicleID, latAlignment);
1262 }
1263 
1264 
1265 void
1266 Vehicle::highlight(const std::string& vehicleID, const libsumo::TraCIColor& col, double size, const int alphaMax, const double duration, const int type) {
1267  tcpip::Storage content;
1268  if (alphaMax > 0) {
1269  //self._setCmd(tc.VAR_HIGHLIGHT, vehID, "tcdBdB", 5, color, size, alphaMax, duration, type)
1271  content.writeInt(5);
1273  content.writeUnsignedByte(col.r);
1274  content.writeUnsignedByte(col.g);
1275  content.writeUnsignedByte(col.b);
1276  content.writeUnsignedByte(col.a);
1278  content.writeDouble(size);
1280  content.writeByte(alphaMax);
1282  content.writeDouble(size);
1284  content.writeByte(type);
1286  } else {
1287  //self._setCmd(tc.VAR_HIGHLIGHT, vehID, "tcd", 2, color, size)
1289  content.writeInt(2);
1291  content.writeUnsignedByte(col.r);
1292  content.writeUnsignedByte(col.g);
1293  content.writeUnsignedByte(col.b);
1294  content.writeUnsignedByte(col.a);
1296  content.writeDouble(size);
1298  }
1299 }
1300 
1301 void
1302 Vehicle::dispatchTaxi(const std::string& vehicleID, const std::vector<std::string>& reservations) {
1303  Dom::setStringVector(libsumo::CMD_TAXI_DISPATCH, vehicleID, reservations);
1304 }
1305 
1306 
1307 void
1308 Vehicle::subscribeLeader(const std::string& vehicleID, double dist, double beginTime, double endTime) {
1309 }
1310 
1311 
1312 void
1313 Vehicle::addSubscriptionFilterLanes(const std::vector<int>& lanes, bool noOpposite, double downstreamDist, double upstreamDist) {
1314 }
1315 
1316 
1317 void
1318 Vehicle::addSubscriptionFilterNoOpposite() {
1319 }
1320 
1321 
1322 void
1323 Vehicle::addSubscriptionFilterDownstreamDistance(double dist) {
1324 }
1325 
1326 
1327 void
1328 Vehicle::addSubscriptionFilterUpstreamDistance(double dist) {
1329 }
1330 
1331 
1332 void
1333 Vehicle::addSubscriptionFilterCFManeuver(double downstreamDist, double upstreamDist) {
1334 }
1335 
1336 
1337 void
1338 Vehicle::addSubscriptionFilterLCManeuver(int direction, bool noOpposite, double downstreamDist, double upstreamDist) {
1339 }
1340 
1341 
1342 void
1343 Vehicle::addSubscriptionFilterLeadFollow(const std::vector<int>& lanes) {
1344 }
1345 
1346 
1347 void
1348 Vehicle::addSubscriptionFilterTurn(double downstreamDist, double upstreamDist) {
1349 }
1350 
1351 
1352 void
1353 Vehicle::addSubscriptionFilterVClass(const std::vector<std::string>& vClasses) {
1354 }
1355 
1356 
1357 void
1358 Vehicle::addSubscriptionFilterVType(const std::vector<std::string>& vTypes) {
1359 }
1360 
1361 
1362 void
1363 Vehicle::addSubscriptionFilterFieldOfVision(double openingAngle) {
1364 }
1365 
1366 
1367 void
1368 Vehicle::addSubscriptionFilterLateralDistance(double lateralDist, double downstreamDist, double upstreamDist) {
1369 }
1370 
1371 
1372 }
1373 
1374 
1375 /****************************************************************************/
#define LIBTRACI_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
Definition: Domain.h:36
#define LIBTRACI_PARAMETER_IMPLEMENTATION(CLASS, DOMAIN)
Definition: Domain.h:74
C++ TraCI client API implementation.
Definition: Vehicle.h:41
static Connection & getActive()
Definition: Connection.h:53
tcpip::Storage & doCommand(int command, int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Connection.cpp:366
static void setDouble(int var, const std::string &id, double value)
Definition: Domain.h:156
static libsumo::TraCIPosition getPos(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:128
static void setCol(int var, const std::string &id, const libsumo::TraCIColor value)
Definition: Domain.h:168
static void setStringVector(int var, const std::string &id, const std::vector< std::string > &value)
Definition: Domain.h:164
static std::vector< std::string > getStringVector(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:140
static libsumo::TraCIColor getCol(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:144
static std::string getString(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:136
static int getInt(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:116
static libsumo::TraCIPosition getPos3D(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:132
static double getDouble(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition: Domain.h:120
static void setInt(int var, const std::string &id, int value)
Definition: Domain.h:152
static void setString(int var, const std::string &id, const std::string &value)
Definition: Domain.h:160
virtual std::string readString()
Definition: storage.cpp:175
virtual void writeString(const std::string &s)
Definition: storage.cpp:192
virtual void writeInt(int)
Definition: storage.cpp:316
virtual void writeDouble(double)
Definition: storage.cpp:349
virtual int readUnsignedByte()
Definition: storage.cpp:150
virtual void writeUnsignedByte(int)
Definition: storage.cpp:160
virtual void writeByte(int)
Definition: storage.cpp:135
virtual int readByte()
Definition: storage.cpp:123
virtual double readDouble()
Definition: storage.cpp:357
virtual int readInt()
Definition: storage.cpp:306
TRACI_CONST double INVALID_DOUBLE_VALUE
TRACI_CONST int VAR_LASTACTIONTIME
TRACI_CONST int TYPE_COLOR
TRACI_CONST int VAR_NOXEMISSION
TRACI_CONST int VAR_LANECHANGE_MODE
TRACI_CONST int LAST_STEP_PERSON_ID_LIST
TRACI_CONST int VAR_VEHICLECLASS
TRACI_CONST int TRACI_ID_LIST
TRACI_CONST int VAR_LATALIGNMENT
TRACI_CONST int VAR_TYPE
TRACI_CONST int CMD_CHANGESUBLANE
TRACI_CONST int VAR_ROUTING_MODE
TRACI_CONST int VAR_MINGAP
TRACI_CONST int CMD_TAXI_DISPATCH
TRACI_CONST int VAR_SECURE_GAP
TRACI_CONST int VAR_SHAPECLASS
TRACI_CONST int VAR_WAITING_TIME
TRACI_CONST int CMD_STOP
TRACI_CONST int VAR_LINE
TRACI_CONST int VAR_EDGE_TRAVELTIME
TRACI_CONST int VAR_ROAD_ID
TRACI_CONST int CMD_GET_VEHICLE_VARIABLE
TRACI_CONST int CMD_RESUME
TRACI_CONST int VAR_ACTIONSTEPLENGTH
TRACI_CONST int VAR_SPEED_FACTOR
TRACI_CONST int MOVE_TO_XY
TRACI_CONST int VAR_FOLLOW_SPEED
TRACI_CONST int VAR_STOP_ARRIVALDELAY
TRACI_CONST int VAR_SPEED_LAT
TRACI_CONST int VAR_ANGLE
TRACI_CONST int VAR_TAU
TRACI_CONST int TYPE_COMPOUND
TRACI_CONST int VAR_NEXT_TLS
TRACI_CONST int VAR_EDGE_EFFORT
TRACI_CONST int VAR_ROUTE
TRACI_CONST int VAR_BEST_LANES
TRACI_CONST int VAR_ALLOWED_SPEED
TRACI_CONST int VAR_LANE_INDEX
TRACI_CONST int VAR_PMXEMISSION
TRACI_CONST int VAR_SPEED_WITHOUT_TRACI
TRACI_CONST int VAR_HIGHLIGHT
TRACI_CONST int VAR_MOVE_TO
TRACI_CONST int VAR_PERSON_NUMBER
TRACI_CONST int VAR_COEMISSION
TRACI_CONST int VAR_COLOR
TRACI_CONST int VAR_POSITION
TRACI_CONST int VAR_WIDTH
TRACI_CONST int VAR_PERSON_CAPACITY
TRACI_CONST int VAR_MAXSPEED
TRACI_CONST int VAR_LEADER
TRACI_CONST int CMD_CHANGETARGET
TRACI_CONST int ADD_FULL
TRACI_CONST int VAR_CO2EMISSION
TRACI_CONST int CMD_REROUTE_TO_PARKING
TRACI_CONST int CMD_REROUTE_TRAVELTIME
TRACI_CONST int VAR_TAXI_FLEET
TRACI_CONST int TYPE_INTEGER
TRACI_CONST int VAR_PREV_SPEED
TRACI_CONST int VAR_ROUTE_VALID
TRACI_CONST int VAR_SPEEDSETMODE
TRACI_CONST int CMD_REPLACE_STOP
TRACI_CONST int CMD_SET_VEHICLE_VARIABLE
TRACI_CONST int VAR_FUELCONSUMPTION
TRACI_CONST int VAR_SLOPE
TRACI_CONST int VAR_LENGTH
TRACI_CONST int VAR_MAXSPEED_LAT
TRACI_CONST int CMD_REROUTE_EFFORT
TRACI_CONST int VAR_HCEMISSION
TRACI_CONST int ID_COUNT
TRACI_CONST int VAR_LANEPOSITION
TRACI_CONST int REMOVE
TRACI_CONST int VAR_LANE_ID
TRACI_CONST int VAR_STOP_SPEED
TRACI_CONST int VAR_IMPERFECTION
TRACI_CONST int VAR_HEIGHT
TRACI_CONST int VAR_APPARENT_DECEL
TRACI_CONST int VAR_NOISEEMISSION
TRACI_CONST int VAR_POSITION3D
TRACI_CONST int VAR_SPEED
TRACI_CONST int VAR_DECEL
TRACI_CONST int VAR_SIGNALS
TRACI_CONST int VAR_ACCUMULATED_WAITING_TIME
TRACI_CONST int VAR_MINGAP_LAT
TRACI_CONST int INVALID_INT_VALUE
TRACI_CONST int VAR_ROUTE_INDEX
TRACI_CONST int VAR_NEXT_STOPS2
TRACI_CONST int CMD_SLOWDOWN
TRACI_CONST int VAR_ACCELERATION
TRACI_CONST int VAR_ROUTE_ID
TRACI_CONST int TYPE_DOUBLE
TRACI_CONST int TYPE_BYTE
TRACI_CONST int CMD_OPENGAP
TRACI_CONST int VAR_LANEPOSITION_LAT
TRACI_CONST int CMD_CHANGELANE
TRACI_CONST int VAR_STOP_DELAY
TRACI_CONST int VAR_EMERGENCY_DECEL
TRACI_CONST int VAR_STOPSTATE
TRACI_CONST int VAR_FOLLOWER
TRACI_CONST int VAR_EMISSIONCLASS
TRACI_CONST int VAR_ACCEL
TRACI_CONST int VAR_DISTANCE
TRACI_CONST int VAR_ELECTRICITYCONSUMPTION
TRACI_CONST int VAR_SPEED_DEVIATION
TRACI_CONST int VAR_VIA
TRACI_CONST int TYPE_STRING
Domain< libsumo::CMD_GET_BUSSTOP_VARIABLE, libsumo::CMD_SET_BUSSTOP_VARIABLE > Dom
double length
The length than can be driven from that lane without lane change.
Definition: TraCIDefs.h:456
double occupation
The traffic density along length.
Definition: TraCIDefs.h:458
bool allowsContinuation
Whether this lane allows continuing the route.
Definition: TraCIDefs.h:462
int bestLaneOffset
The offset of this lane from the best lane.
Definition: TraCIDefs.h:460
std::vector< std::string > continuationLanes
The sequence of lanes that best allows continuing the route without lane change.
Definition: TraCIDefs.h:464
std::string laneID
The id of the lane.
Definition: TraCIDefs.h:454
std::string stoppingPlaceID
Id assigned to the stop.
Definition: TraCIDefs.h:405
std::string lane
The lane to stop at.
Definition: TraCIDefs.h:399
int stopFlags
Stop flags.
Definition: TraCIDefs.h:407
std::string actType
additional information for this stop
Definition: TraCIDefs.h:423
std::string tripId
id of the trip within a cyclical public transport route
Definition: TraCIDefs.h:425
double startPos
The stopping position start.
Definition: TraCIDefs.h:401
double arrival
The actual arrival time (only for past stops)
Definition: TraCIDefs.h:415
double depart
The time at which this stop was ended.
Definition: TraCIDefs.h:417
std::string join
the id of the vehicle (train portion) to which this vehicle shall be joined
Definition: TraCIDefs.h:421
double speed
the speed at which this stop counts as reached (waypoint mode)
Definition: TraCIDefs.h:429
double intendedArrival
The intended arrival time.
Definition: TraCIDefs.h:413
double endPos
The stopping position end.
Definition: TraCIDefs.h:403
std::string split
the id of the vehicle (train portion) that splits of upon reaching this stop
Definition: TraCIDefs.h:419
std::string line
the new line id of the trip within a cyclical public transport route
Definition: TraCIDefs.h:427
double duration
The intended (minimum) stopping duration.
Definition: TraCIDefs.h:409
double until
The time at which the vehicle may continue its journey.
Definition: TraCIDefs.h:411
double dist
The distance to the tls.
Definition: TraCIDefs.h:348
int tlIndex
The tls index of the controlled link.
Definition: TraCIDefs.h:346
std::string id
The id of the next tls.
Definition: TraCIDefs.h:344
char state
The current state of the tls.
Definition: TraCIDefs.h:350
A 3D-position.
Definition: TraCIDefs.h:141