Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
libtraci/Vehicle.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2017-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/****************************************************************************/
20// C++ TraCI client API implementation
21/****************************************************************************/
22#include <config.h>
23#include <sstream>
24
25#define LIBTRACI 1
27#include <libsumo/Vehicle.h>
28#include "Domain.h"
29
30namespace libtraci {
31
32typedef Domain<libsumo::CMD_GET_VEHICLE_VARIABLE, libsumo::CMD_SET_VEHICLE_VARIABLE> Dom;
33
34
35// ===========================================================================
36// static member definitions
37// ===========================================================================
38std::vector<std::string>
39Vehicle::getIDList() {
41}
42
43
44int
45Vehicle::getIDCount() {
47}
48
49
52
53double
54Vehicle::getSpeed(const std::string& vehID) {
56}
57
58double
59Vehicle::getLateralSpeed(const std::string& vehID) {
61}
62
63double
64Vehicle::getAcceleration(const std::string& vehID) {
66}
67
68
69double
70Vehicle::getSpeedWithoutTraCI(const std::string& vehID) {
72}
73
74
76Vehicle::getPosition(const std::string& vehID, const bool includeZ) {
77 return includeZ ? getPosition3D(vehID) : Dom::getPos(libsumo::VAR_POSITION, vehID);
78}
79
80
82Vehicle::getPosition3D(const std::string& vehID) {
84}
85
86
87double
88Vehicle::getAngle(const std::string& vehID) {
90}
91
92
93double
94Vehicle::getSlope(const std::string& vehID) {
96}
97
98
99std::string
100Vehicle::getRoadID(const std::string& vehID) {
102}
103
104
105double
106Vehicle::getDeparture(const std::string& vehID) {
108}
109
110
111double
112Vehicle::getDepartDelay(const std::string& vehID) {
114}
115
116
117std::string
118Vehicle::getLaneID(const std::string& vehID) {
120}
121
122
123int
124Vehicle::getLaneIndex(const std::string& vehID) {
126}
127
128
129std::string
130Vehicle::getSegmentID(const std::string& vehID) {
132}
133
134
135int
136Vehicle::getSegmentIndex(const std::string& vehID) {
138}
139
140
141std::string
142Vehicle::getTypeID(const std::string& vehID) {
143 return Dom::getString(libsumo::VAR_TYPE, vehID);
144}
145
146
147std::string
148Vehicle::getRouteID(const std::string& vehID) {
150}
151
152
153int
154Vehicle::getRouteIndex(const std::string& vehID) {
156}
157
158
160Vehicle::getColor(const std::string& vehID) {
161 return Dom::getCol(libsumo::VAR_COLOR, vehID);
162}
163
164double
165Vehicle::getLanePosition(const std::string& vehID) {
167}
168
169double
170Vehicle::getLateralLanePosition(const std::string& vehID) {
172}
173
174double
175Vehicle::getCO2Emission(const std::string& vehID) {
177}
178
179double
180Vehicle::getCOEmission(const std::string& vehID) {
182}
183
184double
185Vehicle::getHCEmission(const std::string& vehID) {
187}
188
189double
190Vehicle::getPMxEmission(const std::string& vehID) {
192}
193
194double
195Vehicle::getNOxEmission(const std::string& vehID) {
197}
198
199double
200Vehicle::getFuelConsumption(const std::string& vehID) {
202}
203
204double
205Vehicle::getNoiseEmission(const std::string& vehID) {
207}
208
209double
210Vehicle::getElectricityConsumption(const std::string& vehID) {
212}
213
214int
215Vehicle::getPersonNumber(const std::string& vehID) {
217}
218
219int
220Vehicle::getPersonCapacity(const std::string& vehID) {
222}
223
224
225double
226Vehicle::getBoardingDuration(const std::string& vehID) {
228}
229
230
231double
232Vehicle::getImpatience(const std::string& vehID) {
234}
235
236
237std::vector<std::string>
238Vehicle::getPersonIDList(const std::string& vehID) {
240}
241
242std::pair<std::string, double>
243Vehicle::getLeader(const std::string& vehID, double dist) {
244 tcpip::Storage content;
245 StoHelp::writeTypedDouble(content, dist);
246 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
247 tcpip::Storage& ret = Dom::get(libsumo::VAR_LEADER, vehID, &content);
248 ret.readInt(); // components
249 ret.readUnsignedByte();
250 const std::string leaderID = ret.readString();
251 ret.readUnsignedByte();
252 const double gap = ret.readDouble();
253 return std::make_pair(leaderID, gap);
254}
255
256
257std::pair<std::string, double>
258Vehicle::getFollower(const std::string& vehID, double dist) {
259 tcpip::Storage content;
260 StoHelp::writeTypedDouble(content, dist);
261 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
262 tcpip::Storage& ret = Dom::get(libsumo::VAR_FOLLOWER, vehID, &content);
263 ret.readInt(); // components
264 const std::string leaderID = StoHelp::readTypedString(ret);
265 return std::make_pair(leaderID, StoHelp::readTypedDouble(ret));
266}
267
268
269std::vector<libsumo::TraCIJunctionFoe>
270Vehicle::getJunctionFoes(const std::string& vehID, double dist) {
271 std::vector<libsumo::TraCIJunctionFoe> result;
272 tcpip::Storage content;
273 StoHelp::writeTypedDouble(content, dist);
274 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
275 tcpip::Storage& ret = Dom::get(libsumo::VAR_FOES, vehID, &content);
276 ret.readInt(); // compound size
278 return result;
279}
280
281
282double
283Vehicle::getWaitingTime(const std::string& vehID) {
285}
286
287
288double
289Vehicle::getAccumulatedWaitingTime(const std::string& vehID) {
291}
292
293
294double
295Vehicle::getAdaptedTraveltime(const std::string& vehID, double time, const std::string& edgeID) {
296 tcpip::Storage content;
297 StoHelp::writeCompound(content, 2);
298 StoHelp::writeTypedDouble(content, time);
299 StoHelp::writeTypedString(content, edgeID);
300 return Dom::getDouble(libsumo::VAR_EDGE_TRAVELTIME, vehID, &content);
301}
302
303
304double
305Vehicle::getEffort(const std::string& vehID, double time, const std::string& edgeID) {
306 tcpip::Storage content;
307 StoHelp::writeCompound(content, 2);
308 StoHelp::writeTypedDouble(content, time);
309 StoHelp::writeTypedString(content, edgeID);
310 return Dom::getDouble(libsumo::VAR_EDGE_EFFORT, vehID, &content);
311}
312
313
314bool
315Vehicle::isRouteValid(const std::string& vehID) {
316 return Dom::getInt(libsumo::VAR_ROUTE_VALID, vehID) != 0;
317}
318
319
320std::vector<std::string>
321Vehicle::getRoute(const std::string& vehID) {
323}
324
325
326int
327Vehicle::getSignals(const std::string& vehID) {
328 return Dom::getInt(libsumo::VAR_SIGNALS, vehID);
329}
330
331
332std::vector<libsumo::TraCIBestLanesData>
333Vehicle::getBestLanes(const std::string& vehID) {
334 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
335 std::vector<libsumo::TraCIBestLanesData> result;
337 ret.readInt();
338 StoHelp::readBestLanesVector(ret, result);
339 return result;
340}
341
342
343std::vector<libsumo::TraCINextTLSData>
344Vehicle::getNextTLS(const std::string& vehID) {
345 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
346 std::vector<libsumo::TraCINextTLSData> result;
348 ret.readInt(); // components
349 StoHelp::readTLSDataVector(ret, result);
350 return result;
351}
352
353std::vector<libsumo::TraCINextStopData>
354Vehicle::getNextStops(const std::string& vehID) {
355 return getStops(vehID, 0);
356}
357
358std::vector<libsumo::TraCIConnection>
359Vehicle::getNextLinks(const std::string& vehID) {
360 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
361 std::vector<libsumo::TraCIConnection> result;
363 ret.readInt(); // components
364 // number of items
365 const int linkNo = StoHelp::readTypedInt(ret);
366 for (int i = 0; i < linkNo; ++i) {
368 StoHelp::readConnection(ret, con);
369 result.emplace_back(con);
370 }
371 return result;
372}
373
374std::vector<libsumo::TraCINextStopData>
375Vehicle::getStops(const std::string& vehID, int limit) {
376 std::vector<libsumo::TraCINextStopData> result;
377 tcpip::Storage content;
378 StoHelp::writeTypedInt(content, limit);
379 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
380 tcpip::Storage& ret = Dom::get(libsumo::VAR_NEXT_STOPS2, vehID, &content);
381 ret.readInt(); // components
382 StoHelp::readStopVector(ret, result);
383 return result;
384}
385
386std::string
387Vehicle::getStopParameter(const std::string& vehID, int nextStopIndex, const std::string& param, bool customParam) {
388 tcpip::Storage content;
389 StoHelp::writeCompound(content, 3);
390 StoHelp::writeTypedInt(content, nextStopIndex);
391 StoHelp::writeTypedString(content, param);
392 StoHelp::writeTypedByte(content, customParam);
393 return Dom::getString(libsumo::VAR_STOP_PARAMETER, vehID, &content);
394}
395
396int
397Vehicle::getStopState(const std::string& vehID) {
398 return Dom::getInt(libsumo::VAR_STOPSTATE, vehID);
399}
400
401
402double
403Vehicle::getDistance(const std::string& vehID) {
405}
406
407
408double
409Vehicle::getDrivingDistance(const std::string& vehID, const std::string& edgeID, double pos, int laneIndex) {
410 tcpip::Storage content;
411 StoHelp::writeCompound(content, 2);
413 content.writeString(edgeID);
414 content.writeDouble(pos);
415 content.writeUnsignedByte(laneIndex);
417 return Dom::getDouble(libsumo::DISTANCE_REQUEST, vehID, &content);
418}
419
420
421double
422Vehicle::getDrivingDistance2D(const std::string& vehID, double x, double y) {
423 tcpip::Storage content;
424 StoHelp::writeCompound(content, 2);
426 content.writeDouble(x);
427 content.writeDouble(y);
429 return Dom::getDouble(libsumo::DISTANCE_REQUEST, vehID, &content);
430}
431
432
433double
434Vehicle::getAllowedSpeed(const std::string& vehID) {
436}
437
438
439double
440Vehicle::getSpeedFactor(const std::string& vehID) {
442}
443
444
445int
446Vehicle::getSpeedMode(const std::string& vehID) {
448}
449
450
451int
452Vehicle::getLaneChangeMode(const std::string& vehID) {
454}
455
456
457int
458Vehicle::getRoutingMode(const std::string& vehID) {
460}
461
462
463std::string
464Vehicle::getLine(const std::string& vehID) {
465 return Dom::getString(libsumo::VAR_LINE, vehID);
466}
467
468
469
470std::vector<std::string>
471Vehicle::getVia(const std::string& vehID) {
473}
474
475
476std::pair<int, int>
477Vehicle::getLaneChangeState(const std::string& vehID, int direction) {
478 tcpip::Storage content;
479 StoHelp::writeTypedInt(content, direction);
480 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
481 tcpip::Storage& ret = Dom::get(libsumo::CMD_CHANGELANE, vehID, &content);
482 ret.readInt(); // components
483 const int stateWithoutTraCI = StoHelp::readTypedInt(ret);
484 const int state = StoHelp::readTypedInt(ret);
485 return std::make_pair(stateWithoutTraCI, state);
486}
487
488
489std::vector<std::pair<std::string, double> >
490Vehicle::getNeighbors(const std::string& vehID, const int mode) {
491 std::vector<std::pair<std::string, double> > neighs;
492 tcpip::Storage content;
494 content.writeUnsignedByte(mode);
495 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
496 tcpip::Storage& ret = Dom::get(libsumo::VAR_NEIGHBORS, vehID, &content);
497 const int items = ret.readInt(); // components
498 for (int i = 0; i < items; i++) {
499 const std::string neighID = ret.readString();
500 neighs.emplace_back(neighID, ret.readDouble());
501 }
502 return neighs;
503}
504
505
506double
507Vehicle::getFollowSpeed(const std::string& vehID, double speed, double gap, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) {
508 tcpip::Storage content;
509 StoHelp::writeCompound(content, 5);
510 StoHelp::writeTypedDouble(content, speed);
511 StoHelp::writeTypedDouble(content, gap);
512 StoHelp::writeTypedDouble(content, leaderSpeed);
513 StoHelp::writeTypedDouble(content, leaderMaxDecel);
514 StoHelp::writeTypedString(content, leaderID);
515 return Dom::getDouble(libsumo::VAR_FOLLOW_SPEED, vehID, &content);
516}
517
518
519double
520Vehicle::getSecureGap(const std::string& vehID, double speed, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) {
521 tcpip::Storage content;
522 StoHelp::writeCompound(content, 4);
523 StoHelp::writeTypedDouble(content, speed);
524 StoHelp::writeTypedDouble(content, leaderSpeed);
525 StoHelp::writeTypedDouble(content, leaderMaxDecel);
526 StoHelp::writeTypedString(content, leaderID);
527 return Dom::getDouble(libsumo::VAR_SECURE_GAP, vehID, &content);
528}
529
530
531double
532Vehicle::getStopSpeed(const std::string& vehID, const double speed, double gap) {
533 tcpip::Storage content;
534 StoHelp::writeCompound(content, 2);
535 StoHelp::writeTypedDouble(content, speed);
536 StoHelp::writeTypedDouble(content, gap);
537 return Dom::getDouble(libsumo::VAR_STOP_SPEED, vehID, &content);
538}
539
540double
541Vehicle::getStopDelay(const std::string& vehID) {
543}
544
545double
546Vehicle::getStopArrivalDelay(const std::string& vehID) {
548}
549
550double
551Vehicle::getTimeLoss(const std::string& vehID) {
553}
554
555std::vector<std::string>
556Vehicle::getTaxiFleet(int taxiState) {
557 tcpip::Storage content;
558 StoHelp::writeTypedInt(content, taxiState);
559 return Dom::getStringVector(libsumo::VAR_TAXI_FLEET, "", &content);
560}
561
562std::vector<std::string>
563Vehicle::getLoadedIDList() {
565}
566
567std::vector<std::string>
568Vehicle::getTeleportingIDList() {
570}
571
572std::string
573Vehicle::getEmissionClass(const std::string& vehID) {
575}
576
577std::string
578Vehicle::getShapeClass(const std::string& vehID) {
580}
581
582
583double
584Vehicle::getLength(const std::string& vehID) {
585 return Dom::getDouble(libsumo::VAR_LENGTH, vehID);
586}
587
588
589double
590Vehicle::getAccel(const std::string& vehID) {
591 return Dom::getDouble(libsumo::VAR_ACCEL, vehID);
592}
593
594
595double
596Vehicle::getDecel(const std::string& vehID) {
597 return Dom::getDouble(libsumo::VAR_DECEL, vehID);
598}
599
600
601double Vehicle::getEmergencyDecel(const std::string& vehID) {
603}
604
605
606double Vehicle::getApparentDecel(const std::string& vehID) {
608}
609
610
611double Vehicle::getActionStepLength(const std::string& vehID) {
613}
614
615
616double Vehicle::getLastActionTime(const std::string& vehID) {
618}
619
620
621double
622Vehicle::getTau(const std::string& vehID) {
623 return Dom::getDouble(libsumo::VAR_TAU, vehID);
624}
625
626
627double
628Vehicle::getImperfection(const std::string& vehID) {
630}
631
632
633double
634Vehicle::getSpeedDeviation(const std::string& vehID) {
636}
637
638
639std::string
640Vehicle::getVehicleClass(const std::string& vehID) {
642}
643
644
645double
646Vehicle::getMinGap(const std::string& vehID) {
647 return Dom::getDouble(libsumo::VAR_MINGAP, vehID);
648}
649
650
651double
652Vehicle::getMinGapLat(const std::string& vehID) {
654}
655
656
657double
658Vehicle::getMaxSpeed(const std::string& vehID) {
660}
661
662
663double
664Vehicle::getMaxSpeedLat(const std::string& vehID) {
666}
667
668
669std::string
670Vehicle::getLateralAlignment(const std::string& vehID) {
672}
673
674
675double
676Vehicle::getWidth(const std::string& vehID) {
677 return Dom::getDouble(libsumo::VAR_WIDTH, vehID);
678}
679
680
681double
682Vehicle::getHeight(const std::string& vehID) {
683 return Dom::getDouble(libsumo::VAR_HEIGHT, vehID);
684}
685
686
687double
688Vehicle::getMass(const std::string& vehID) {
689 return Dom::getDouble(libsumo::VAR_MASS, vehID);
690}
691
692
693void
694Vehicle::setStop(const std::string& vehID,
695 const std::string& edgeID,
696 double pos,
697 int laneIndex,
698 double duration,
699 int flags,
700 double startPos,
701 double until) {
702 tcpip::Storage content;
703 StoHelp::writeCompound(content, 7);
704 StoHelp::writeTypedString(content, edgeID);
705 StoHelp::writeTypedDouble(content, pos);
706 StoHelp::writeTypedByte(content, laneIndex);
707 StoHelp::writeTypedDouble(content, duration);
708 StoHelp::writeTypedByte(content, flags);
709 StoHelp::writeTypedDouble(content, startPos);
710 StoHelp::writeTypedDouble(content, until);
711 Dom::set(libsumo::CMD_STOP, vehID, &content);
712}
713
714
715void
716Vehicle::replaceStop(const std::string& vehID,
717 int nextStopIndex,
718 const std::string& edgeID,
719 double pos,
720 int laneIndex,
721 double duration,
722 int flags,
723 double startPos,
724 double until,
725 int teleport) {
726 tcpip::Storage content;
727 StoHelp::writeCompound(content, 9);
728 StoHelp::writeTypedString(content, edgeID);
729 StoHelp::writeTypedDouble(content, pos);
730 StoHelp::writeTypedByte(content, laneIndex);
731 StoHelp::writeTypedDouble(content, duration);
732 StoHelp::writeTypedInt(content, flags);
733 StoHelp::writeTypedDouble(content, startPos);
734 StoHelp::writeTypedDouble(content, until);
735 StoHelp::writeTypedInt(content, nextStopIndex);
736 StoHelp::writeTypedByte(content, teleport);
737 Dom::set(libsumo::CMD_REPLACE_STOP, vehID, &content);
738}
739
740
741void
742Vehicle::insertStop(const std::string& vehID,
743 int nextStopIndex,
744 const std::string& edgeID,
745 double pos,
746 int laneIndex,
747 double duration,
748 int flags,
749 double startPos,
750 double until,
751 int teleport) {
752 tcpip::Storage content;
753 StoHelp::writeCompound(content, 9);
754 StoHelp::writeTypedString(content, edgeID);
755 StoHelp::writeTypedDouble(content, pos);
756 StoHelp::writeTypedByte(content, laneIndex);
757 StoHelp::writeTypedDouble(content, duration);
758 StoHelp::writeTypedInt(content, flags);
759 StoHelp::writeTypedDouble(content, startPos);
760 StoHelp::writeTypedDouble(content, until);
761 StoHelp::writeTypedInt(content, nextStopIndex);
762 StoHelp::writeTypedByte(content, teleport);
763 Dom::set(libsumo::CMD_INSERT_STOP, vehID, &content);
764}
765
766
767void
768Vehicle::setStopParameter(const std::string& vehID, int nextStopIndex,
769 const std::string& param, const std::string& value,
770 bool customParam) {
771 tcpip::Storage content;
772 StoHelp::writeCompound(content, 4);
773 StoHelp::writeTypedInt(content, nextStopIndex);
774 StoHelp::writeTypedString(content, param);
775 StoHelp::writeTypedString(content, value);
776 StoHelp::writeTypedByte(content, customParam);
777 Dom::set(libsumo::VAR_STOP_PARAMETER, vehID, &content);
778}
779
780
781void
782Vehicle::rerouteParkingArea(const std::string& vehID, const std::string& parkingAreaID) {
783 tcpip::Storage content;
784 StoHelp::writeCompound(content, 1);
785 StoHelp::writeTypedString(content, parkingAreaID);
787}
788
789
790void
791Vehicle::resume(const std::string& vehID) {
792 tcpip::Storage content;
793 StoHelp::writeCompound(content, 0);
794 Dom::set(libsumo::CMD_RESUME, vehID, &content);
795}
796
797
798void
799Vehicle::changeTarget(const std::string& vehID, const std::string& edgeID) {
801}
802
803
804void
805Vehicle::changeLane(const std::string& vehID, int laneIndex, double duration) {
806 tcpip::Storage content;
807 StoHelp::writeCompound(content, 2);
808 StoHelp::writeTypedByte(content, laneIndex);
809 StoHelp::writeTypedDouble(content, duration);
810 Dom::set(libsumo::CMD_CHANGELANE, vehID, &content);
811}
812
813void
814Vehicle::changeLaneRelative(const std::string& vehID, int indexOffset, double duration) {
815 tcpip::Storage content;
816 StoHelp::writeCompound(content, 3);
817 StoHelp::writeTypedByte(content, indexOffset);
818 StoHelp::writeTypedDouble(content, duration);
819 StoHelp::writeTypedByte(content, 1);
820 Dom::set(libsumo::CMD_CHANGELANE, vehID, &content);
821}
822
823
824void
825Vehicle::changeSublane(const std::string& vehID, double latDist) {
827}
828
829
830void
831Vehicle::add(const std::string& vehID,
832 const std::string& routeID,
833 const std::string& typeID,
834 const std::string& depart,
835 const std::string& departLane,
836 const std::string& departPos,
837 const std::string& departSpeed,
838 const std::string& arrivalLane,
839 const std::string& arrivalPos,
840 const std::string& arrivalSpeed,
841 const std::string& fromTaz,
842 const std::string& toTaz,
843 const std::string& line,
844 int personCapacity,
845 int personNumber) {
846 tcpip::Storage content;
847 StoHelp::writeCompound(content, 14);
848 StoHelp::writeTypedString(content, routeID);
849 StoHelp::writeTypedString(content, typeID);
850 StoHelp::writeTypedString(content, depart);
851 StoHelp::writeTypedString(content, departLane);
852 StoHelp::writeTypedString(content, departPos);
853 StoHelp::writeTypedString(content, departSpeed);
854
855 StoHelp::writeTypedString(content, arrivalLane);
856 StoHelp::writeTypedString(content, arrivalPos);
857 StoHelp::writeTypedString(content, arrivalSpeed);
858
859 StoHelp::writeTypedString(content, fromTaz);
860 StoHelp::writeTypedString(content, toTaz);
861 StoHelp::writeTypedString(content, line);
862
863 StoHelp::writeTypedInt(content, personCapacity);
864 StoHelp::writeTypedInt(content, personNumber);
865
866 Dom::set(libsumo::ADD_FULL, vehID, &content);
867}
868
869
870void
871Vehicle::moveToXY(const std::string& vehID, const std::string& edgeID, const int laneIndex,
872 const double x, const double y, double angle, const int keepRoute, double matchThreshold) {
873 tcpip::Storage content;
874 StoHelp::writeCompound(content, 7);
875 StoHelp::writeTypedString(content, edgeID);
876 StoHelp::writeTypedInt(content, laneIndex);
877 StoHelp::writeTypedDouble(content, x);
878 StoHelp::writeTypedDouble(content, y);
879 StoHelp::writeTypedDouble(content, angle);
880 StoHelp::writeTypedByte(content, keepRoute);
881 StoHelp::writeTypedDouble(content, matchThreshold);
882 Dom::set(libsumo::MOVE_TO_XY, vehID, &content);
883}
884
885void
886Vehicle::slowDown(const std::string& vehID, double speed, double duration) {
887 tcpip::Storage content;
888 StoHelp::writeCompound(content, 2);
889 StoHelp::writeTypedDouble(content, speed);
890 StoHelp::writeTypedDouble(content, duration);
891 Dom::set(libsumo::CMD_SLOWDOWN, vehID, &content);
892}
893
894void
895Vehicle::openGap(const std::string& vehID, double newTimeHeadway, double newSpaceHeadway, double duration, double changeRate, double maxDecel, const std::string& referenceVehID) {
896 tcpip::Storage content;
897 StoHelp::writeCompound(content, referenceVehID != "" ? 6 : 5);
898 StoHelp::writeTypedDouble(content, newTimeHeadway);
899 StoHelp::writeTypedDouble(content, newSpaceHeadway);
900 StoHelp::writeTypedDouble(content, duration);
901 StoHelp::writeTypedDouble(content, changeRate);
902 StoHelp::writeTypedDouble(content, maxDecel);
903 if (referenceVehID != "") {
904 StoHelp::writeTypedString(content, referenceVehID);
905 }
906 Dom::set(libsumo::CMD_OPENGAP, vehID, &content);
907}
908
909void
910Vehicle::deactivateGapControl(const std::string& vehID) {
911 openGap(vehID, -1, -1, -1, -1);
912}
913
914void
915Vehicle::requestToC(const std::string& vehID, double leadTime) {
916 std::ostringstream oss;
917 oss.setf(std::ios::fixed, std::ios::floatfield);
918 oss << std::setprecision(2);
919 oss << leadTime;
920 setParameter(vehID, "device.toc.requestToC", oss.str());
921}
922
923void
924Vehicle::setSpeed(const std::string& vehID, double speed) {
925 Dom::setDouble(libsumo::VAR_SPEED, vehID, speed);
926}
927
928void
929Vehicle::setAcceleration(const std::string& vehID, double acceleration, double duration) {
930 tcpip::Storage content;
931 StoHelp::writeCompound(content, 2);
932 StoHelp::writeTypedDouble(content, acceleration);
933 StoHelp::writeTypedDouble(content, duration);
934 Dom::set(libsumo::VAR_ACCELERATION, vehID, &content);
935}
936
937void
938Vehicle::setPreviousSpeed(const std::string& vehID, double prevSpeed, double prevAcceleration) {
939 tcpip::Storage content;
940 StoHelp::writeCompound(content, 2);
941 StoHelp::writeTypedDouble(content, prevSpeed);
942 StoHelp::writeTypedDouble(content, prevAcceleration);
943 Dom::set(libsumo::VAR_PREV_SPEED, vehID, &content);
944}
945
946void
947Vehicle::setSpeedMode(const std::string& vehID, int speedMode) {
948 Dom::setInt(libsumo::VAR_SPEEDSETMODE, vehID, speedMode);
949}
950
951void
952Vehicle::setLaneChangeMode(const std::string& vehID, int laneChangeMode) {
953 Dom::setInt(libsumo::VAR_LANECHANGE_MODE, vehID, laneChangeMode);
954}
955
956void
957Vehicle::setRoutingMode(const std::string& vehID, int routingMode) {
958 Dom::setInt(libsumo::VAR_ROUTING_MODE, vehID, routingMode);
959}
960
961void
962Vehicle::setType(const std::string& vehID, const std::string& typeID) {
963 Dom::setString(libsumo::VAR_TYPE, vehID, typeID);
964}
965
966void
967Vehicle::setRouteID(const std::string& vehID, const std::string& routeID) {
968 Dom::setString(libsumo::VAR_ROUTE_ID, vehID, routeID);
969}
970
971void
972Vehicle::setRoute(const std::string& vehID, const std::string& edgeID) {
973 setRoute(vehID, std::vector<std::string>({edgeID}));
974}
975
976void
977Vehicle::setRoute(const std::string& vehID, const std::vector<std::string>& edgeIDs) {
979}
980
981void
982Vehicle::setLateralLanePosition(const std::string& vehID, double posLat) {
984}
985
986void
987Vehicle::updateBestLanes(const std::string& vehID) {
988 tcpip::Storage content;
989 Dom::set(libsumo::VAR_UPDATE_BESTLANES, vehID, &content);
990}
991
992
993void
994Vehicle::setAdaptedTraveltime(const std::string& vehID, const std::string& edgeID,
995 double time, double begSeconds, double endSeconds) {
996 tcpip::Storage content;
997 if (time == libsumo::INVALID_DOUBLE_VALUE) {
998 // reset
999 StoHelp::writeCompound(content, 1);
1000 StoHelp::writeTypedString(content, edgeID);
1001 } else if (begSeconds == libsumo::INVALID_DOUBLE_VALUE) {
1002 // set value for the whole simulation
1003 StoHelp::writeCompound(content, 2);
1004 StoHelp::writeTypedString(content, edgeID);
1005 StoHelp::writeTypedDouble(content, time);
1006 } else {
1007 StoHelp::writeCompound(content, 4);
1008 StoHelp::writeTypedDouble(content, begSeconds);
1009 StoHelp::writeTypedDouble(content, endSeconds);
1010 StoHelp::writeTypedString(content, edgeID);
1011 StoHelp::writeTypedDouble(content, time);
1012 }
1013 Dom::set(libsumo::VAR_EDGE_TRAVELTIME, vehID, &content);
1014}
1015
1016
1017void
1018Vehicle::setEffort(const std::string& vehID, const std::string& edgeID,
1019 double effort, double begSeconds, double endSeconds) {
1020 tcpip::Storage content;
1021 if (effort == libsumo::INVALID_DOUBLE_VALUE) {
1022 // reset
1023 StoHelp::writeCompound(content, 1);
1024 StoHelp::writeTypedString(content, edgeID);
1025 } else if (begSeconds == libsumo::INVALID_DOUBLE_VALUE) {
1026 // set value for the whole simulation
1027 StoHelp::writeCompound(content, 2);
1028 StoHelp::writeTypedString(content, edgeID);
1029 StoHelp::writeTypedDouble(content, effort);
1030 } else {
1031 StoHelp::writeCompound(content, 4);
1032 StoHelp::writeTypedDouble(content, begSeconds);
1033 StoHelp::writeTypedDouble(content, endSeconds);
1034 StoHelp::writeTypedString(content, edgeID);
1035 StoHelp::writeTypedDouble(content, effort);
1036 }
1037 Dom::set(libsumo::VAR_EDGE_EFFORT, vehID, &content);
1038}
1039
1040
1041void
1042Vehicle::rerouteTraveltime(const std::string& vehID, const bool /* currentTravelTimes */) {
1043 tcpip::Storage content;
1044 StoHelp::writeCompound(content, 0);
1045 Dom::set(libsumo::CMD_REROUTE_TRAVELTIME, vehID, &content);
1046}
1047
1048
1049void
1050Vehicle::rerouteEffort(const std::string& vehID) {
1051 tcpip::Storage content;
1052 StoHelp::writeCompound(content, 0);
1053 Dom::set(libsumo::CMD_REROUTE_EFFORT, vehID, &content);
1054}
1055
1056
1057void
1058Vehicle::setSignals(const std::string& vehID, int signals) {
1059 Dom::setInt(libsumo::VAR_SIGNALS, vehID, signals);
1060}
1061
1062
1063void
1064Vehicle::moveTo(const std::string& vehID, const std::string& laneID, double pos, int reason) {
1065 tcpip::Storage content;
1066 StoHelp::writeCompound(content, 3);
1067 StoHelp::writeTypedString(content, laneID);
1068 StoHelp::writeTypedDouble(content, pos);
1069 StoHelp::writeTypedInt(content, reason);
1070 Dom::set(libsumo::VAR_MOVE_TO, vehID, &content);
1071}
1072
1073
1074void
1075Vehicle::setActionStepLength(const std::string& vehID, double actionStepLength, bool resetActionOffset) {
1076 //if (actionStepLength < 0) {
1077 // raise TraCIException("Invalid value for actionStepLength. Given value must be non-negative.")
1078 //{
1079 // Use negative value to indicate resetActionOffset == False
1080 if (!resetActionOffset) {
1081 actionStepLength *= -1;
1082 }
1083 Dom::setDouble(libsumo::VAR_ACTIONSTEPLENGTH, vehID, actionStepLength);
1084}
1085
1086
1087void
1088Vehicle::remove(const std::string& vehID, char reason) {
1089 tcpip::Storage content;
1091 content.writeUnsignedByte(reason);
1092 Dom::set(libsumo::REMOVE, vehID, &content);
1093}
1094
1095
1096void
1097Vehicle::setColor(const std::string& vehID, const libsumo::TraCIColor& color) {
1098 Dom::setCol(libsumo::VAR_COLOR, vehID, color);
1099}
1100
1101
1102void
1103Vehicle::setSpeedFactor(const std::string& vehID, double factor) {
1105}
1106
1107
1108void
1109Vehicle::setLine(const std::string& vehID, const std::string& line) {
1110 Dom::setString(libsumo::VAR_LINE, vehID, line);
1111}
1112
1113
1114void
1115Vehicle::setVia(const std::string& vehID, const std::vector<std::string>& edgeList) {
1116 Dom::setStringVector(libsumo::VAR_VIA, vehID, edgeList);
1117}
1118
1119
1120void
1121Vehicle::setLength(const std::string& vehID, double length) {
1122 Dom::setDouble(libsumo::VAR_LENGTH, vehID, length);
1123}
1124
1125
1126void
1127Vehicle::setMaxSpeed(const std::string& vehID, double speed) {
1129}
1130
1131
1132void
1133Vehicle::setVehicleClass(const std::string& vehID, const std::string& clazz) {
1135}
1136
1137
1138void
1139Vehicle::setShapeClass(const std::string& vehID, const std::string& clazz) {
1141}
1142
1143
1144void
1145Vehicle::setEmissionClass(const std::string& vehID, const std::string& clazz) {
1147}
1148
1149
1150void
1151Vehicle::setWidth(const std::string& vehID, double width) {
1152 Dom::setDouble(libsumo::VAR_WIDTH, vehID, width);
1153}
1154
1155
1156void
1157Vehicle::setHeight(const std::string& vehID, double height) {
1158 Dom::setDouble(libsumo::VAR_HEIGHT, vehID, height);
1159}
1160
1161
1162void
1163Vehicle::setMass(const std::string& vehID, double mass) {
1164 Dom::setDouble(libsumo::VAR_MASS, vehID, mass);
1165}
1166
1167
1168void
1169Vehicle::setMinGap(const std::string& vehID, double minGap) {
1170 Dom::setDouble(libsumo::VAR_MINGAP, vehID, minGap);
1171}
1172
1173
1174void
1175Vehicle::setAccel(const std::string& vehID, double accel) {
1176 Dom::setDouble(libsumo::VAR_ACCEL, vehID, accel);
1177}
1178
1179
1180void
1181Vehicle::setDecel(const std::string& vehID, double decel) {
1182 Dom::setDouble(libsumo::VAR_DECEL, vehID, decel);
1183}
1184
1185
1186void
1187Vehicle::setEmergencyDecel(const std::string& vehID, double decel) {
1189}
1190
1191
1192void
1193Vehicle::setApparentDecel(const std::string& vehID, double decel) {
1195}
1196
1197
1198void
1199Vehicle::setImperfection(const std::string& vehID, double imperfection) {
1200 Dom::setDouble(libsumo::VAR_IMPERFECTION, vehID, imperfection);
1201}
1202
1203
1204void
1205Vehicle::setTau(const std::string& vehID, double tau) {
1206 Dom::setDouble(libsumo::VAR_TAU, vehID, tau);
1207}
1208
1209
1210void
1211Vehicle::setMinGapLat(const std::string& vehID, double minGapLat) {
1212 Dom::setDouble(libsumo::VAR_MINGAP_LAT, vehID, minGapLat);
1213}
1214
1215
1216void
1217Vehicle::setMaxSpeedLat(const std::string& vehID, double speed) {
1219}
1220
1221
1222void
1223Vehicle::setLateralAlignment(const std::string& vehID, const std::string& latAlignment) {
1224 Dom::setString(libsumo::VAR_LATALIGNMENT, vehID, latAlignment);
1225}
1226
1227
1228void
1229Vehicle::setImpatience(const std::string& vehID, double impatience) {
1230 Dom::setDouble(libsumo::VAR_IMPATIENCE, vehID, impatience);
1231}
1232
1233void
1234Vehicle::setBoardingDuration(const std::string& vehID, double boardingDuration) {
1235 Dom::setDouble(libsumo::VAR_BOARDING_DURATION, vehID, boardingDuration);
1236}
1237
1238
1239void
1240Vehicle::highlight(const std::string& vehID, const libsumo::TraCIColor& col, double size, const int alphaMax, const double duration, const int type) {
1241 tcpip::Storage content;
1242 StoHelp::writeCompound(content, alphaMax > 0 ? 5 : 2);
1244 content.writeUnsignedByte(col.r);
1245 content.writeUnsignedByte(col.g);
1246 content.writeUnsignedByte(col.b);
1247 content.writeUnsignedByte(col.a);
1248 StoHelp::writeTypedDouble(content, size);
1249 if (alphaMax > 0) {
1251 content.writeUnsignedByte(alphaMax);
1252 StoHelp::writeTypedDouble(content, duration);
1254 content.writeUnsignedByte(type);
1255 }
1256 Dom::set(libsumo::VAR_HIGHLIGHT, vehID, &content);
1257}
1258
1259void
1260Vehicle::dispatchTaxi(const std::string& vehID, const std::vector<std::string>& reservations) {
1262}
1263
1264
1265void
1266Vehicle::subscribeLeader(const std::string& vehID, double dist, double begin, double end) {
1267 subscribe(vehID, std::vector<int>({ libsumo::VAR_LEADER }), begin, end,
1268 libsumo::TraCIResults({ {libsumo::VAR_LEADER, std::make_shared<libsumo::TraCIDouble>(dist)} }));
1269}
1270
1271
1272void
1273Vehicle::addSubscriptionFilterLanes(const std::vector<int>& lanes, bool noOpposite, double downstreamDist, double upstreamDist) {
1274 tcpip::Storage content;
1275 content.writeUnsignedByte((int)lanes.size());
1276 for (int lane : lanes) {
1277 content.writeUnsignedByte(lane < 0 ? lane + 256 : lane);
1278 }
1280 if (noOpposite) {
1281 addSubscriptionFilterNoOpposite();
1282 }
1283 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1284 addSubscriptionFilterDownstreamDistance(downstreamDist);
1285 }
1286 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1287 addSubscriptionFilterUpstreamDistance(upstreamDist);
1288 }
1289}
1290
1291
1292void
1293Vehicle::addSubscriptionFilterNoOpposite() {
1295}
1296
1297
1298void
1299Vehicle::addSubscriptionFilterDownstreamDistance(double dist) {
1300 tcpip::Storage content;
1301 StoHelp::writeTypedDouble(content, dist);
1303}
1304
1305
1306void
1307Vehicle::addSubscriptionFilterUpstreamDistance(double dist) {
1308 tcpip::Storage content;
1309 StoHelp::writeTypedDouble(content, dist);
1311}
1312
1313
1314void
1315Vehicle::addSubscriptionFilterCFManeuver(double downstreamDist, double upstreamDist) {
1316 addSubscriptionFilterLeadFollow(std::vector<int>(1));
1317 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1318 addSubscriptionFilterDownstreamDistance(downstreamDist);
1319 }
1320 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1321 addSubscriptionFilterUpstreamDistance(upstreamDist);
1322 }
1323}
1324
1325
1326void
1327Vehicle::addSubscriptionFilterLCManeuver(int direction, bool noOpposite, double downstreamDist, double upstreamDist) {
1328 if (direction == libsumo::INVALID_INT_VALUE) {
1329 addSubscriptionFilterLeadFollow({ -1, 0, 1 });
1330 } else if (direction != -1 && direction != 1) {
1331 // warnings.warn("Ignoring lane change subscription filter with non-neighboring lane offset direction=%s." % direction)
1332 return;
1333 } else {
1334 addSubscriptionFilterLeadFollow({ 0, direction });
1335 }
1336 if (noOpposite) {
1337 addSubscriptionFilterNoOpposite();
1338 }
1339 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1340 addSubscriptionFilterDownstreamDistance(downstreamDist);
1341 }
1342 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1343 addSubscriptionFilterUpstreamDistance(upstreamDist);
1344 }
1345}
1346
1347
1348void
1349Vehicle::addSubscriptionFilterLeadFollow(const std::vector<int>& lanes) {
1351 addSubscriptionFilterLanes(lanes);
1352}
1353
1354
1355void
1356Vehicle::addSubscriptionFilterTurn(double downstreamDist, double foeDistToJunction) {
1357 tcpip::Storage content;
1358 StoHelp::writeTypedDouble(content, foeDistToJunction);
1360 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1361 addSubscriptionFilterDownstreamDistance(downstreamDist);
1362 }
1363}
1364
1365
1366void
1367Vehicle::addSubscriptionFilterVClass(const std::vector<std::string>& vClasses) {
1368 tcpip::Storage content;
1369 StoHelp::writeTypedStringList(content, vClasses);
1371}
1372
1373
1374void
1375Vehicle::addSubscriptionFilterVType(const std::vector<std::string>& vTypes) {
1376 tcpip::Storage content;
1377 StoHelp::writeTypedStringList(content, vTypes);
1379}
1380
1381
1382void
1383Vehicle::addSubscriptionFilterFieldOfVision(double openingAngle) {
1384 tcpip::Storage content;
1385 StoHelp::writeTypedDouble(content, openingAngle);
1387}
1388
1389
1390void
1391Vehicle::addSubscriptionFilterLateralDistance(double lateralDist, double downstreamDist, double upstreamDist) {
1392 tcpip::Storage content;
1393 StoHelp::writeTypedDouble(content, lateralDist);
1395 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1396 addSubscriptionFilterDownstreamDistance(downstreamDist);
1397 }
1398 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1399 addSubscriptionFilterUpstreamDistance(upstreamDist);
1400 }
1401}
1402
1403
1404}
1405
1406
1407/****************************************************************************/
#define LIBTRACI_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
Definition Domain.h:38
#define LIBTRACI_PARAMETER_IMPLEMENTATION(CLASS, DOMAIN)
Definition Domain.h:77
C++ TraCI client API implementation.
static void readJunctionFoeVector(tcpip::Storage &inputStorage, std::vector< libsumo::TraCIJunctionFoe > &result, const std::string &error="")
static void writeTypedDouble(tcpip::Storage &content, double value)
static void readConnection(tcpip::Storage &inputStorage, libsumo::TraCIConnection &connection, const std::string &error="")
static void readStopVector(tcpip::Storage &inputStorage, std::vector< libsumo::TraCINextStopData > &result, const std::string &error="")
static int readTypedInt(tcpip::Storage &ret, const std::string &error="")
static void writeCompound(tcpip::Storage &content, int size)
static void readBestLanesVector(tcpip::Storage &inputStorage, std::vector< libsumo::TraCIBestLanesData > &result, const std::string &error="")
static std::string readTypedString(tcpip::Storage &ret, const std::string &error="")
static void writeTypedInt(tcpip::Storage &content, int value)
static void writeTypedStringList(tcpip::Storage &content, const std::vector< std::string > &value)
static void writeTypedByte(tcpip::Storage &content, int value)
static void writeTypedString(tcpip::Storage &content, const std::string &value)
static void readTLSDataVector(tcpip::Storage &inputStorage, std::vector< libsumo::TraCINextTLSData > &result, const std::string &error="")
static double readTypedDouble(tcpip::Storage &ret, const std::string &error="")
static Connection & getActive()
Definition Connection.h:57
void addFilter(int var, tcpip::Storage *add=nullptr)
std::mutex & getMutex() const
Definition Connection.h:76
static void setDouble(int var, const std::string &id, double value)
Definition Domain.h:221
static libsumo::TraCIPosition getPos(int var, const std::string &id, tcpip::Storage *add=nullptr, const bool isGeo=false)
Definition Domain.h:143
static void setCol(int var, const std::string &id, const libsumo::TraCIColor value)
Definition Domain.h:242
static std::vector< std::string > getStringVector(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition Domain.h:167
static void setStringVector(int var, const std::string &id, const std::vector< std::string > &value)
Definition Domain.h:235
static libsumo::TraCIColor getCol(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition Domain.h:177
static std::string getString(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition Domain.h:162
static int getInt(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition Domain.h:125
static void set(int var, const std::string &id, tcpip::Storage *add)
Definition Domain.h:209
static libsumo::TraCIPosition getPos3D(int var, const std::string &id, tcpip::Storage *add=nullptr, const bool isGeo=false)
Definition Domain.h:152
static double getDouble(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition Domain.h:130
static void setInt(int var, const std::string &id, int value)
Definition Domain.h:214
static void setString(int var, const std::string &id, const std::string &value)
Definition Domain.h:228
static tcpip::Storage & get(int var, const std::string &id, tcpip::Storage *add=nullptr, int expectedType=libsumo::TYPE_COMPOUND)
Definition Domain.h:111
virtual std::string readString()
Definition storage.cpp:180
virtual void writeString(const std::string &s)
Definition storage.cpp:197
virtual void writeDouble(double)
Definition storage.cpp:354
virtual int readUnsignedByte()
Definition storage.cpp:155
virtual void writeUnsignedByte(int)
Definition storage.cpp:165
virtual double readDouble()
Definition storage.cpp:362
virtual int readInt()
Definition storage.cpp:311
TRACI_CONST double INVALID_DOUBLE_VALUE
TRACI_CONST int VAR_LASTACTIONTIME
TRACI_CONST int TYPE_COLOR
TRACI_CONST int FILTER_TYPE_DOWNSTREAM_DIST
TRACI_CONST int VAR_EDGES
TRACI_CONST int POSITION_ROADMAP
TRACI_CONST int VAR_NOXEMISSION
TRACI_CONST int VAR_LANECHANGE_MODE
TRACI_CONST int LAST_STEP_PERSON_ID_LIST
TRACI_CONST int FILTER_TYPE_NOOPPOSITE
TRACI_CONST int VAR_VEHICLECLASS
TRACI_CONST int TRACI_ID_LIST
TRACI_CONST int VAR_IMPATIENCE
TRACI_CONST int VAR_LATALIGNMENT
TRACI_CONST int VAR_SEGMENT_ID
TRACI_CONST int VAR_TYPE
TRACI_CONST int CMD_CHANGESUBLANE
TRACI_CONST int VAR_DEPARTURE
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 VAR_TIMELOSS
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 FILTER_TYPE_FIELD_OF_VISION
TRACI_CONST int VAR_ANGLE
TRACI_CONST int VAR_TAU
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_BOARDING_DURATION
TRACI_CONST int TYPE_UBYTE
TRACI_CONST int VAR_MOVE_TO
TRACI_CONST int VAR_PERSON_NUMBER
TRACI_CONST int VAR_COEMISSION
TRACI_CONST int VAR_UPDATE_BESTLANES
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_STOP_PARAMETER
TRACI_CONST int POSITION_2D
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 FILTER_TYPE_VTYPE
TRACI_CONST int VAR_TELEPORTING_LIST
TRACI_CONST int CMD_REROUTE_TRAVELTIME
TRACI_CONST int VAR_TAXI_FLEET
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 VAR_MASS
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 CMD_INSERT_STOP
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 FILTER_TYPE_LEAD_FOLLOW
TRACI_CONST int REQUEST_DRIVINGDIST
TRACI_CONST int VAR_POSITION3D
TRACI_CONST int VAR_SPEED
TRACI_CONST int VAR_DECEL
TRACI_CONST int VAR_SIGNALS
TRACI_CONST int FILTER_TYPE_UPSTREAM_DIST
TRACI_CONST int VAR_ACCUMULATED_WAITING_TIME
TRACI_CONST int VAR_MINGAP_LAT
TRACI_CONST int INVALID_INT_VALUE
TRACI_CONST int VAR_NEXT_LINKS
TRACI_CONST int VAR_ROUTE_INDEX
TRACI_CONST int VAR_NEXT_STOPS2
TRACI_CONST int CMD_SLOWDOWN
TRACI_CONST int FILTER_TYPE_TURN
TRACI_CONST int VAR_ACCELERATION
TRACI_CONST int VAR_ROUTE_ID
TRACI_CONST int DISTANCE_REQUEST
TRACI_CONST int TYPE_BYTE
TRACI_CONST int VAR_SEGMENT_INDEX
TRACI_CONST int CMD_OPENGAP
TRACI_CONST int VAR_LANEPOSITION_LAT
TRACI_CONST int FILTER_TYPE_VCLASS
TRACI_CONST int CMD_CHANGELANE
TRACI_CONST int VAR_STOP_DELAY
TRACI_CONST int VAR_NEIGHBORS
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_LOADED_LIST
TRACI_CONST int FILTER_TYPE_LANES
TRACI_CONST int VAR_ACCEL
TRACI_CONST int VAR_DEPART_DELAY
std::map< int, std::shared_ptr< libsumo::TraCIResult > > TraCIResults
{variable->value}
Definition TraCIDefs.h:376
TRACI_CONST int VAR_FOES
TRACI_CONST int VAR_DISTANCE
TRACI_CONST int FILTER_TYPE_LATERAL_DIST
TRACI_CONST int VAR_ELECTRICITYCONSUMPTION
TRACI_CONST int VAR_SPEED_DEVIATION
TRACI_CONST int VAR_VIA
Domain< libsumo::CMD_GET_BUSSTOP_VARIABLE, libsumo::CMD_SET_BUSSTOP_VARIABLE > Dom
A 2D or 3D-position, for 2D positions z == INVALID_DOUBLE_VALUE.
Definition TraCIDefs.h:179