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
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::getReferenceDistance(const std::string& vehID) {
436}
437
438
439double
440Vehicle::getAllowedSpeed(const std::string& vehID) {
442}
443
444
445double
446Vehicle::getSpeedFactor(const std::string& vehID) {
448}
449
450
451int
452Vehicle::getSpeedMode(const std::string& vehID) {
454}
455
456
457int
458Vehicle::getLaneChangeMode(const std::string& vehID) {
460}
461
462
463int
464Vehicle::getRoutingMode(const std::string& vehID) {
466}
467
468
469std::string
470Vehicle::getLine(const std::string& vehID) {
471 return Dom::getString(libsumo::VAR_LINE, vehID);
472}
473
474
475
476std::vector<std::string>
477Vehicle::getVia(const std::string& vehID) {
479}
480
481
482std::pair<int, int>
483Vehicle::getLaneChangeState(const std::string& vehID, int direction) {
484 tcpip::Storage content;
485 StoHelp::writeTypedInt(content, direction);
486 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
487 tcpip::Storage& ret = Dom::get(libsumo::CMD_CHANGELANE, vehID, &content);
488 ret.readInt(); // components
489 const int stateWithoutTraCI = StoHelp::readTypedInt(ret);
490 const int state = StoHelp::readTypedInt(ret);
491 return std::make_pair(stateWithoutTraCI, state);
492}
493
494
495std::vector<std::pair<std::string, double> >
496Vehicle::getNeighbors(const std::string& vehID, const int mode) {
497 std::vector<std::pair<std::string, double> > neighs;
498 tcpip::Storage content;
500 content.writeUnsignedByte(mode);
501 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
502 tcpip::Storage& ret = Dom::get(libsumo::VAR_NEIGHBORS, vehID, &content);
503 const int items = ret.readInt(); // components
504 for (int i = 0; i < items; i++) {
505 const std::string neighID = ret.readString();
506 neighs.emplace_back(neighID, ret.readDouble());
507 }
508 return neighs;
509}
510
511
512double
513Vehicle::getFollowSpeed(const std::string& vehID, double speed, double gap, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) {
514 tcpip::Storage content;
515 StoHelp::writeCompound(content, 5);
516 StoHelp::writeTypedDouble(content, speed);
517 StoHelp::writeTypedDouble(content, gap);
518 StoHelp::writeTypedDouble(content, leaderSpeed);
519 StoHelp::writeTypedDouble(content, leaderMaxDecel);
520 StoHelp::writeTypedString(content, leaderID);
521 return Dom::getDouble(libsumo::VAR_FOLLOW_SPEED, vehID, &content);
522}
523
524
525double
526Vehicle::getSecureGap(const std::string& vehID, double speed, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) {
527 tcpip::Storage content;
528 StoHelp::writeCompound(content, 4);
529 StoHelp::writeTypedDouble(content, speed);
530 StoHelp::writeTypedDouble(content, leaderSpeed);
531 StoHelp::writeTypedDouble(content, leaderMaxDecel);
532 StoHelp::writeTypedString(content, leaderID);
533 return Dom::getDouble(libsumo::VAR_SECURE_GAP, vehID, &content);
534}
535
536
537double
538Vehicle::getStopSpeed(const std::string& vehID, const double speed, double gap) {
539 tcpip::Storage content;
540 StoHelp::writeCompound(content, 2);
541 StoHelp::writeTypedDouble(content, speed);
542 StoHelp::writeTypedDouble(content, gap);
543 return Dom::getDouble(libsumo::VAR_STOP_SPEED, vehID, &content);
544}
545
546double
547Vehicle::getStopDelay(const std::string& vehID) {
549}
550
551double
552Vehicle::getStopArrivalDelay(const std::string& vehID) {
554}
555
556double
557Vehicle::getTimeLoss(const std::string& vehID) {
559}
560
561std::vector<std::string>
562Vehicle::getTaxiFleet(int taxiState) {
563 tcpip::Storage content;
564 StoHelp::writeTypedInt(content, taxiState);
565 return Dom::getStringVector(libsumo::VAR_TAXI_FLEET, "", &content);
566}
567
568std::vector<std::string>
569Vehicle::getLoadedIDList() {
571}
572
573std::vector<std::string>
574Vehicle::getTeleportingIDList() {
576}
577
578std::string
579Vehicle::getEmissionClass(const std::string& vehID) {
581}
582
583std::string
584Vehicle::getShapeClass(const std::string& vehID) {
586}
587
588
589double
590Vehicle::getLength(const std::string& vehID) {
591 return Dom::getDouble(libsumo::VAR_LENGTH, vehID);
592}
593
594
595double
596Vehicle::getAccel(const std::string& vehID) {
597 return Dom::getDouble(libsumo::VAR_ACCEL, vehID);
598}
599
600
601double
602Vehicle::getDecel(const std::string& vehID) {
603 return Dom::getDouble(libsumo::VAR_DECEL, vehID);
604}
605
606
607double Vehicle::getEmergencyDecel(const std::string& vehID) {
609}
610
611
612double Vehicle::getApparentDecel(const std::string& vehID) {
614}
615
616
617double Vehicle::getActionStepLength(const std::string& vehID) {
619}
620
621
622double Vehicle::getLastActionTime(const std::string& vehID) {
624}
625
626
627double
628Vehicle::getTau(const std::string& vehID) {
629 return Dom::getDouble(libsumo::VAR_TAU, vehID);
630}
631
632
633double
634Vehicle::getImperfection(const std::string& vehID) {
636}
637
638
639double
640Vehicle::getSpeedDeviation(const std::string& vehID) {
642}
643
644
645std::string
646Vehicle::getVehicleClass(const std::string& vehID) {
648}
649
650
651double
652Vehicle::getMinGap(const std::string& vehID) {
653 return Dom::getDouble(libsumo::VAR_MINGAP, vehID);
654}
655
656
657double
658Vehicle::getMinGapLat(const std::string& vehID) {
660}
661
662
663double
664Vehicle::getMaxSpeed(const std::string& vehID) {
666}
667
668
669double
670Vehicle::getMaxSpeedLat(const std::string& vehID) {
672}
673
674
675std::string
676Vehicle::getLateralAlignment(const std::string& vehID) {
678}
679
680
681double
682Vehicle::getWidth(const std::string& vehID) {
683 return Dom::getDouble(libsumo::VAR_WIDTH, vehID);
684}
685
686
687double
688Vehicle::getHeight(const std::string& vehID) {
689 return Dom::getDouble(libsumo::VAR_HEIGHT, vehID);
690}
691
692
693double
694Vehicle::getMass(const std::string& vehID) {
695 return Dom::getDouble(libsumo::VAR_MASS, vehID);
696}
697
698
699void
700Vehicle::setStop(const std::string& vehID,
701 const std::string& edgeID,
702 double pos,
703 int laneIndex,
704 double duration,
705 int flags,
706 double startPos,
707 double until) {
708 tcpip::Storage content;
709 StoHelp::writeCompound(content, 7);
710 StoHelp::writeTypedString(content, edgeID);
711 StoHelp::writeTypedDouble(content, pos);
712 StoHelp::writeTypedByte(content, laneIndex);
713 StoHelp::writeTypedDouble(content, duration);
714 StoHelp::writeTypedByte(content, flags);
715 StoHelp::writeTypedDouble(content, startPos);
716 StoHelp::writeTypedDouble(content, until);
717 Dom::set(libsumo::CMD_STOP, vehID, &content);
718}
719
720
721void
722Vehicle::replaceStop(const std::string& vehID,
723 int nextStopIndex,
724 const std::string& edgeID,
725 double pos,
726 int laneIndex,
727 double duration,
728 int flags,
729 double startPos,
730 double until,
731 int teleport) {
732 tcpip::Storage content;
733 StoHelp::writeCompound(content, 9);
734 StoHelp::writeTypedString(content, edgeID);
735 StoHelp::writeTypedDouble(content, pos);
736 StoHelp::writeTypedByte(content, laneIndex);
737 StoHelp::writeTypedDouble(content, duration);
738 StoHelp::writeTypedInt(content, flags);
739 StoHelp::writeTypedDouble(content, startPos);
740 StoHelp::writeTypedDouble(content, until);
741 StoHelp::writeTypedInt(content, nextStopIndex);
742 StoHelp::writeTypedByte(content, teleport);
743 Dom::set(libsumo::CMD_REPLACE_STOP, vehID, &content);
744}
745
746
747void
748Vehicle::insertStop(const std::string& vehID,
749 int nextStopIndex,
750 const std::string& edgeID,
751 double pos,
752 int laneIndex,
753 double duration,
754 int flags,
755 double startPos,
756 double until,
757 int teleport) {
758 tcpip::Storage content;
759 StoHelp::writeCompound(content, 9);
760 StoHelp::writeTypedString(content, edgeID);
761 StoHelp::writeTypedDouble(content, pos);
762 StoHelp::writeTypedByte(content, laneIndex);
763 StoHelp::writeTypedDouble(content, duration);
764 StoHelp::writeTypedInt(content, flags);
765 StoHelp::writeTypedDouble(content, startPos);
766 StoHelp::writeTypedDouble(content, until);
767 StoHelp::writeTypedInt(content, nextStopIndex);
768 StoHelp::writeTypedByte(content, teleport);
769 Dom::set(libsumo::CMD_INSERT_STOP, vehID, &content);
770}
771
772
773void
774Vehicle::setStopParameter(const std::string& vehID, int nextStopIndex,
775 const std::string& param, const std::string& value,
776 bool customParam) {
777 tcpip::Storage content;
778 StoHelp::writeCompound(content, 4);
779 StoHelp::writeTypedInt(content, nextStopIndex);
780 StoHelp::writeTypedString(content, param);
781 StoHelp::writeTypedString(content, value);
782 StoHelp::writeTypedByte(content, customParam);
783 Dom::set(libsumo::VAR_STOP_PARAMETER, vehID, &content);
784}
785
786
787void
788Vehicle::rerouteParkingArea(const std::string& vehID, const std::string& parkingAreaID) {
789 tcpip::Storage content;
790 StoHelp::writeCompound(content, 1);
791 StoHelp::writeTypedString(content, parkingAreaID);
793}
794
795
796void
797Vehicle::resume(const std::string& vehID) {
798 tcpip::Storage content;
799 StoHelp::writeCompound(content, 0);
800 Dom::set(libsumo::CMD_RESUME, vehID, &content);
801}
802
803
804void
805Vehicle::changeTarget(const std::string& vehID, const std::string& edgeID) {
807}
808
809
810void
811Vehicle::changeLane(const std::string& vehID, int laneIndex, double duration) {
812 tcpip::Storage content;
813 StoHelp::writeCompound(content, 2);
814 StoHelp::writeTypedByte(content, laneIndex);
815 StoHelp::writeTypedDouble(content, duration);
816 Dom::set(libsumo::CMD_CHANGELANE, vehID, &content);
817}
818
819void
820Vehicle::changeLaneRelative(const std::string& vehID, int indexOffset, double duration) {
821 tcpip::Storage content;
822 StoHelp::writeCompound(content, 3);
823 StoHelp::writeTypedByte(content, indexOffset);
824 StoHelp::writeTypedDouble(content, duration);
825 StoHelp::writeTypedByte(content, 1);
826 Dom::set(libsumo::CMD_CHANGELANE, vehID, &content);
827}
828
829
830void
831Vehicle::changeSublane(const std::string& vehID, double latDist) {
833}
834
835
836void
837Vehicle::add(const std::string& vehID,
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;
853 StoHelp::writeCompound(content, 14);
854 StoHelp::writeTypedString(content, routeID);
855 StoHelp::writeTypedString(content, typeID);
856 StoHelp::writeTypedString(content, depart);
857 StoHelp::writeTypedString(content, departLane);
858 StoHelp::writeTypedString(content, departPos);
859 StoHelp::writeTypedString(content, departSpeed);
860
861 StoHelp::writeTypedString(content, arrivalLane);
862 StoHelp::writeTypedString(content, arrivalPos);
863 StoHelp::writeTypedString(content, arrivalSpeed);
864
865 StoHelp::writeTypedString(content, fromTaz);
866 StoHelp::writeTypedString(content, toTaz);
867 StoHelp::writeTypedString(content, line);
868
869 StoHelp::writeTypedInt(content, personCapacity);
870 StoHelp::writeTypedInt(content, personNumber);
871
872 Dom::set(libsumo::ADD_FULL, vehID, &content);
873}
874
875
876void
877Vehicle::moveToXY(const std::string& vehID, const std::string& edgeID, const int laneIndex,
878 const double x, const double y, double angle, const int keepRoute, double matchThreshold) {
879 tcpip::Storage content;
880 StoHelp::writeCompound(content, 7);
881 StoHelp::writeTypedString(content, edgeID);
882 StoHelp::writeTypedInt(content, laneIndex);
883 StoHelp::writeTypedDouble(content, x);
884 StoHelp::writeTypedDouble(content, y);
885 StoHelp::writeTypedDouble(content, angle);
886 StoHelp::writeTypedByte(content, keepRoute);
887 StoHelp::writeTypedDouble(content, matchThreshold);
888 Dom::set(libsumo::MOVE_TO_XY, vehID, &content);
889}
890
891void
892Vehicle::slowDown(const std::string& vehID, double speed, double duration) {
893 tcpip::Storage content;
894 StoHelp::writeCompound(content, 2);
895 StoHelp::writeTypedDouble(content, speed);
896 StoHelp::writeTypedDouble(content, duration);
897 Dom::set(libsumo::CMD_SLOWDOWN, vehID, &content);
898}
899
900void
901Vehicle::openGap(const std::string& vehID, double newTimeHeadway, double newSpaceHeadway, double duration, double changeRate, double maxDecel, const std::string& referenceVehID) {
902 tcpip::Storage content;
903 StoHelp::writeCompound(content, referenceVehID != "" ? 6 : 5);
904 StoHelp::writeTypedDouble(content, newTimeHeadway);
905 StoHelp::writeTypedDouble(content, newSpaceHeadway);
906 StoHelp::writeTypedDouble(content, duration);
907 StoHelp::writeTypedDouble(content, changeRate);
908 StoHelp::writeTypedDouble(content, maxDecel);
909 if (referenceVehID != "") {
910 StoHelp::writeTypedString(content, referenceVehID);
911 }
912 Dom::set(libsumo::CMD_OPENGAP, vehID, &content);
913}
914
915void
916Vehicle::deactivateGapControl(const std::string& vehID) {
917 openGap(vehID, -1, -1, -1, -1);
918}
919
920void
921Vehicle::requestToC(const std::string& vehID, double leadTime) {
922 std::ostringstream oss;
923 oss.setf(std::ios::fixed, std::ios::floatfield);
924 oss << std::setprecision(2);
925 oss << leadTime;
926 setParameter(vehID, "device.toc.requestToC", oss.str());
927}
928
929void
930Vehicle::setSpeed(const std::string& vehID, double speed) {
931 Dom::setDouble(libsumo::VAR_SPEED, vehID, speed);
932}
933
934void
935Vehicle::setAcceleration(const std::string& vehID, double acceleration, double duration) {
936 tcpip::Storage content;
937 StoHelp::writeCompound(content, 2);
938 StoHelp::writeTypedDouble(content, acceleration);
939 StoHelp::writeTypedDouble(content, duration);
940 Dom::set(libsumo::VAR_ACCELERATION, vehID, &content);
941}
942
943void
944Vehicle::setPreviousSpeed(const std::string& vehID, double prevSpeed, double prevAcceleration) {
945 tcpip::Storage content;
946 StoHelp::writeCompound(content, 2);
947 StoHelp::writeTypedDouble(content, prevSpeed);
948 StoHelp::writeTypedDouble(content, prevAcceleration);
949 Dom::set(libsumo::VAR_PREV_SPEED, vehID, &content);
950}
951
952void
953Vehicle::setSpeedMode(const std::string& vehID, int speedMode) {
954 Dom::setInt(libsumo::VAR_SPEEDSETMODE, vehID, speedMode);
955}
956
957void
958Vehicle::setLaneChangeMode(const std::string& vehID, int laneChangeMode) {
959 Dom::setInt(libsumo::VAR_LANECHANGE_MODE, vehID, laneChangeMode);
960}
961
962void
963Vehicle::setRoutingMode(const std::string& vehID, int routingMode) {
964 Dom::setInt(libsumo::VAR_ROUTING_MODE, vehID, routingMode);
965}
966
967void
968Vehicle::setType(const std::string& vehID, const std::string& typeID) {
969 Dom::setString(libsumo::VAR_TYPE, vehID, typeID);
970}
971
972void
973Vehicle::setRouteID(const std::string& vehID, const std::string& routeID) {
974 Dom::setString(libsumo::VAR_ROUTE_ID, vehID, routeID);
975}
976
977void
978Vehicle::setRoute(const std::string& vehID, const std::string& edgeID) {
979 setRoute(vehID, std::vector<std::string>({edgeID}));
980}
981
982void
983Vehicle::setRoute(const std::string& vehID, const std::vector<std::string>& edgeIDs) {
985}
986
987void
988Vehicle::setLateralLanePosition(const std::string& vehID, double posLat) {
990}
991
992void
993Vehicle::updateBestLanes(const std::string& vehID) {
994 tcpip::Storage content;
995 Dom::set(libsumo::VAR_UPDATE_BESTLANES, vehID, &content);
996}
997
998
999void
1000Vehicle::setAdaptedTraveltime(const std::string& vehID, const std::string& edgeID,
1001 double time, double begSeconds, double endSeconds) {
1002 tcpip::Storage content;
1003 if (time == libsumo::INVALID_DOUBLE_VALUE) {
1004 // reset
1005 StoHelp::writeCompound(content, 1);
1006 StoHelp::writeTypedString(content, edgeID);
1007 } else if (begSeconds == libsumo::INVALID_DOUBLE_VALUE) {
1008 // set value for the whole simulation
1009 StoHelp::writeCompound(content, 2);
1010 StoHelp::writeTypedString(content, edgeID);
1011 StoHelp::writeTypedDouble(content, time);
1012 } else {
1013 StoHelp::writeCompound(content, 4);
1014 StoHelp::writeTypedDouble(content, begSeconds);
1015 StoHelp::writeTypedDouble(content, endSeconds);
1016 StoHelp::writeTypedString(content, edgeID);
1017 StoHelp::writeTypedDouble(content, time);
1018 }
1019 Dom::set(libsumo::VAR_EDGE_TRAVELTIME, vehID, &content);
1020}
1021
1022
1023void
1024Vehicle::setEffort(const std::string& vehID, const std::string& edgeID,
1025 double effort, double begSeconds, double endSeconds) {
1026 tcpip::Storage content;
1027 if (effort == libsumo::INVALID_DOUBLE_VALUE) {
1028 // reset
1029 StoHelp::writeCompound(content, 1);
1030 StoHelp::writeTypedString(content, edgeID);
1031 } else if (begSeconds == libsumo::INVALID_DOUBLE_VALUE) {
1032 // set value for the whole simulation
1033 StoHelp::writeCompound(content, 2);
1034 StoHelp::writeTypedString(content, edgeID);
1035 StoHelp::writeTypedDouble(content, effort);
1036 } else {
1037 StoHelp::writeCompound(content, 4);
1038 StoHelp::writeTypedDouble(content, begSeconds);
1039 StoHelp::writeTypedDouble(content, endSeconds);
1040 StoHelp::writeTypedString(content, edgeID);
1041 StoHelp::writeTypedDouble(content, effort);
1042 }
1043 Dom::set(libsumo::VAR_EDGE_EFFORT, vehID, &content);
1044}
1045
1046
1047void
1048Vehicle::rerouteTraveltime(const std::string& vehID, const bool /* currentTravelTimes */) {
1049 tcpip::Storage content;
1050 StoHelp::writeCompound(content, 0);
1051 Dom::set(libsumo::CMD_REROUTE_TRAVELTIME, vehID, &content);
1052}
1053
1054
1055void
1056Vehicle::rerouteEffort(const std::string& vehID) {
1057 tcpip::Storage content;
1058 StoHelp::writeCompound(content, 0);
1059 Dom::set(libsumo::CMD_REROUTE_EFFORT, vehID, &content);
1060}
1061
1062
1063void
1064Vehicle::setSignals(const std::string& vehID, int signals) {
1065 Dom::setInt(libsumo::VAR_SIGNALS, vehID, signals);
1066}
1067
1068
1069void
1070Vehicle::moveTo(const std::string& vehID, const std::string& laneID, double pos, int reason) {
1071 tcpip::Storage content;
1072 StoHelp::writeCompound(content, 3);
1073 StoHelp::writeTypedString(content, laneID);
1074 StoHelp::writeTypedDouble(content, pos);
1075 StoHelp::writeTypedInt(content, reason);
1076 Dom::set(libsumo::VAR_MOVE_TO, vehID, &content);
1077}
1078
1079
1080void
1081Vehicle::setActionStepLength(const std::string& vehID, double actionStepLength, bool resetActionOffset) {
1082 //if (actionStepLength < 0) {
1083 // raise TraCIException("Invalid value for actionStepLength. Given value must be non-negative.")
1084 //{
1085 // Use negative value to indicate resetActionOffset == False
1086 if (!resetActionOffset) {
1087 actionStepLength *= -1;
1088 }
1089 Dom::setDouble(libsumo::VAR_ACTIONSTEPLENGTH, vehID, actionStepLength);
1090}
1091
1092
1093void
1094Vehicle::remove(const std::string& vehID, char reason) {
1095 tcpip::Storage content;
1097 content.writeUnsignedByte(reason);
1098 Dom::set(libsumo::REMOVE, vehID, &content);
1099}
1100
1101
1102void
1103Vehicle::setColor(const std::string& vehID, const libsumo::TraCIColor& color) {
1104 Dom::setCol(libsumo::VAR_COLOR, vehID, color);
1105}
1106
1107
1108void
1109Vehicle::setSpeedFactor(const std::string& vehID, double factor) {
1111}
1112
1113
1114void
1115Vehicle::setLine(const std::string& vehID, const std::string& line) {
1116 Dom::setString(libsumo::VAR_LINE, vehID, line);
1117}
1118
1119
1120void
1121Vehicle::setVia(const std::string& vehID, const std::vector<std::string>& edgeList) {
1122 Dom::setStringVector(libsumo::VAR_VIA, vehID, edgeList);
1123}
1124
1125
1126void
1127Vehicle::setLength(const std::string& vehID, double length) {
1128 Dom::setDouble(libsumo::VAR_LENGTH, vehID, length);
1129}
1130
1131
1132void
1133Vehicle::setMaxSpeed(const std::string& vehID, double speed) {
1135}
1136
1137
1138void
1139Vehicle::setVehicleClass(const std::string& vehID, const std::string& clazz) {
1141}
1142
1143
1144void
1145Vehicle::setShapeClass(const std::string& vehID, const std::string& clazz) {
1147}
1148
1149
1150void
1151Vehicle::setEmissionClass(const std::string& vehID, const std::string& clazz) {
1153}
1154
1155
1156void
1157Vehicle::setWidth(const std::string& vehID, double width) {
1158 Dom::setDouble(libsumo::VAR_WIDTH, vehID, width);
1159}
1160
1161
1162void
1163Vehicle::setHeight(const std::string& vehID, double height) {
1164 Dom::setDouble(libsumo::VAR_HEIGHT, vehID, height);
1165}
1166
1167
1168void
1169Vehicle::setMass(const std::string& vehID, double mass) {
1170 Dom::setDouble(libsumo::VAR_MASS, vehID, mass);
1171}
1172
1173
1174void
1175Vehicle::setMinGap(const std::string& vehID, double minGap) {
1176 Dom::setDouble(libsumo::VAR_MINGAP, vehID, minGap);
1177}
1178
1179
1180void
1181Vehicle::setAccel(const std::string& vehID, double accel) {
1182 Dom::setDouble(libsumo::VAR_ACCEL, vehID, accel);
1183}
1184
1185
1186void
1187Vehicle::setDecel(const std::string& vehID, double decel) {
1188 Dom::setDouble(libsumo::VAR_DECEL, vehID, decel);
1189}
1190
1191
1192void
1193Vehicle::setEmergencyDecel(const std::string& vehID, double decel) {
1195}
1196
1197
1198void
1199Vehicle::setApparentDecel(const std::string& vehID, double decel) {
1201}
1202
1203
1204void
1205Vehicle::setImperfection(const std::string& vehID, double imperfection) {
1206 Dom::setDouble(libsumo::VAR_IMPERFECTION, vehID, imperfection);
1207}
1208
1209
1210void
1211Vehicle::setTau(const std::string& vehID, double tau) {
1212 Dom::setDouble(libsumo::VAR_TAU, vehID, tau);
1213}
1214
1215
1216void
1217Vehicle::setMinGapLat(const std::string& vehID, double minGapLat) {
1218 Dom::setDouble(libsumo::VAR_MINGAP_LAT, vehID, minGapLat);
1219}
1220
1221
1222void
1223Vehicle::setMaxSpeedLat(const std::string& vehID, double speed) {
1225}
1226
1227
1228void
1229Vehicle::setLateralAlignment(const std::string& vehID, const std::string& latAlignment) {
1230 Dom::setString(libsumo::VAR_LATALIGNMENT, vehID, latAlignment);
1231}
1232
1233
1234void
1235Vehicle::setImpatience(const std::string& vehID, double impatience) {
1236 Dom::setDouble(libsumo::VAR_IMPATIENCE, vehID, impatience);
1237}
1238
1239void
1240Vehicle::setBoardingDuration(const std::string& vehID, double boardingDuration) {
1241 Dom::setDouble(libsumo::VAR_BOARDING_DURATION, vehID, boardingDuration);
1242}
1243
1244
1245void
1246Vehicle::highlight(const std::string& vehID, const libsumo::TraCIColor& col, double size, const int alphaMax, const double duration, const int type) {
1247 tcpip::Storage content;
1248 StoHelp::writeCompound(content, alphaMax > 0 ? 5 : 2);
1250 content.writeUnsignedByte(col.r);
1251 content.writeUnsignedByte(col.g);
1252 content.writeUnsignedByte(col.b);
1253 content.writeUnsignedByte(col.a);
1254 StoHelp::writeTypedDouble(content, size);
1255 if (alphaMax > 0) {
1257 content.writeUnsignedByte(alphaMax);
1258 StoHelp::writeTypedDouble(content, duration);
1260 content.writeUnsignedByte(type);
1261 }
1262 Dom::set(libsumo::VAR_HIGHLIGHT, vehID, &content);
1263}
1264
1265void
1266Vehicle::dispatchTaxi(const std::string& vehID, const std::vector<std::string>& reservations) {
1268}
1269
1270
1271void
1272Vehicle::subscribeLeader(const std::string& vehID, double dist, double begin, double end) {
1273 subscribe(vehID, std::vector<int>({ libsumo::VAR_LEADER }), begin, end,
1274 libsumo::TraCIResults({ {libsumo::VAR_LEADER, std::make_shared<libsumo::TraCIDouble>(dist)} }));
1275}
1276
1277
1278void
1279Vehicle::addSubscriptionFilterLanes(const std::vector<int>& lanes, bool noOpposite, double downstreamDist, double upstreamDist) {
1280 tcpip::Storage content;
1281 content.writeUnsignedByte((int)lanes.size());
1282 for (int lane : lanes) {
1283 content.writeUnsignedByte(lane < 0 ? lane + 256 : lane);
1284 }
1286 if (noOpposite) {
1287 addSubscriptionFilterNoOpposite();
1288 }
1289 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1290 addSubscriptionFilterDownstreamDistance(downstreamDist);
1291 }
1292 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1293 addSubscriptionFilterUpstreamDistance(upstreamDist);
1294 }
1295}
1296
1297
1298void
1299Vehicle::addSubscriptionFilterNoOpposite() {
1301}
1302
1303
1304void
1305Vehicle::addSubscriptionFilterDownstreamDistance(double dist) {
1306 tcpip::Storage content;
1307 StoHelp::writeTypedDouble(content, dist);
1309}
1310
1311
1312void
1313Vehicle::addSubscriptionFilterUpstreamDistance(double dist) {
1314 tcpip::Storage content;
1315 StoHelp::writeTypedDouble(content, dist);
1317}
1318
1319
1320void
1321Vehicle::addSubscriptionFilterCFManeuver(double downstreamDist, double upstreamDist) {
1322 addSubscriptionFilterLeadFollow(std::vector<int>(1));
1323 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1324 addSubscriptionFilterDownstreamDistance(downstreamDist);
1325 }
1326 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1327 addSubscriptionFilterUpstreamDistance(upstreamDist);
1328 }
1329}
1330
1331
1332void
1333Vehicle::addSubscriptionFilterLCManeuver(int direction, bool noOpposite, double downstreamDist, double upstreamDist) {
1334 if (direction == libsumo::INVALID_INT_VALUE) {
1335 addSubscriptionFilterLeadFollow({ -1, 0, 1 });
1336 } else if (direction != -1 && direction != 1) {
1337 // warnings.warn("Ignoring lane change subscription filter with non-neighboring lane offset direction=%s." % direction)
1338 return;
1339 } else {
1340 addSubscriptionFilterLeadFollow({ 0, direction });
1341 }
1342 if (noOpposite) {
1343 addSubscriptionFilterNoOpposite();
1344 }
1345 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1346 addSubscriptionFilterDownstreamDistance(downstreamDist);
1347 }
1348 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1349 addSubscriptionFilterUpstreamDistance(upstreamDist);
1350 }
1351}
1352
1353
1354void
1355Vehicle::addSubscriptionFilterLeadFollow(const std::vector<int>& lanes) {
1357 addSubscriptionFilterLanes(lanes);
1358}
1359
1360
1361void
1362Vehicle::addSubscriptionFilterTurn(double downstreamDist, double foeDistToJunction) {
1363 tcpip::Storage content;
1364 StoHelp::writeTypedDouble(content, foeDistToJunction);
1366 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1367 addSubscriptionFilterDownstreamDistance(downstreamDist);
1368 }
1369}
1370
1371
1372void
1373Vehicle::addSubscriptionFilterVClass(const std::vector<std::string>& vClasses) {
1374 tcpip::Storage content;
1375 StoHelp::writeTypedStringList(content, vClasses);
1377}
1378
1379
1380void
1381Vehicle::addSubscriptionFilterVType(const std::vector<std::string>& vTypes) {
1382 tcpip::Storage content;
1383 StoHelp::writeTypedStringList(content, vTypes);
1385}
1386
1387
1388void
1389Vehicle::addSubscriptionFilterFieldOfVision(double openingAngle) {
1390 tcpip::Storage content;
1391 StoHelp::writeTypedDouble(content, openingAngle);
1393}
1394
1395
1396void
1397Vehicle::addSubscriptionFilterLateralDistance(double lateralDist, double downstreamDist, double upstreamDist) {
1398 tcpip::Storage content;
1399 StoHelp::writeTypedDouble(content, lateralDist);
1401 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1402 addSubscriptionFilterDownstreamDistance(downstreamDist);
1403 }
1404 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1405 addSubscriptionFilterUpstreamDistance(upstreamDist);
1406 }
1407}
1408
1409
1410}
1411
1412
1413/****************************************************************************/
#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
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