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