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-2024 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
277 const int n = StoHelp::readTypedInt(ret); // number of foe informations
278 for (int i = 0; i < n; ++i) {
287 info.egoResponse = StoHelp::readBool(ret);
288 info.foeResponse = StoHelp::readBool(ret);
289 result.emplace_back(info);
290 }
291 return result;
292}
293
294
295double
296Vehicle::getWaitingTime(const std::string& vehID) {
298}
299
300
301double
302Vehicle::getAccumulatedWaitingTime(const std::string& vehID) {
304}
305
306
307double
308Vehicle::getAdaptedTraveltime(const std::string& vehID, double time, const std::string& edgeID) {
309 tcpip::Storage content;
310 StoHelp::writeCompound(content, 2);
311 StoHelp::writeTypedDouble(content, time);
312 StoHelp::writeTypedString(content, edgeID);
313 return Dom::getDouble(libsumo::VAR_EDGE_TRAVELTIME, vehID, &content);
314}
315
316
317double
318Vehicle::getEffort(const std::string& vehID, double time, const std::string& edgeID) {
319 tcpip::Storage content;
320 StoHelp::writeCompound(content, 2);
321 StoHelp::writeTypedDouble(content, time);
322 StoHelp::writeTypedString(content, edgeID);
323 return Dom::getDouble(libsumo::VAR_EDGE_EFFORT, vehID, &content);
324}
325
326
327bool
328Vehicle::isRouteValid(const std::string& vehID) {
329 return Dom::getInt(libsumo::VAR_ROUTE_VALID, vehID) != 0;
330}
331
332
333std::vector<std::string>
334Vehicle::getRoute(const std::string& vehID) {
336}
337
338
339int
340Vehicle::getSignals(const std::string& vehID) {
341 return Dom::getInt(libsumo::VAR_SIGNALS, vehID);
342}
343
344
345std::vector<libsumo::TraCIBestLanesData>
346Vehicle::getBestLanes(const std::string& vehID) {
347 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
348 std::vector<libsumo::TraCIBestLanesData> result;
350 ret.readInt();
351 ret.readUnsignedByte();
352
353 const int n = ret.readInt(); // number of following edge information
354 for (int i = 0; i < n; ++i) {
356 ret.readUnsignedByte();
357 info.laneID = ret.readString();
358
359 ret.readUnsignedByte();
360 info.length = ret.readDouble();
361
362 ret.readUnsignedByte();
363 info.occupation = ret.readDouble();
364
365 ret.readUnsignedByte();
366 info.bestLaneOffset = ret.readByte();
367
368 ret.readUnsignedByte();
369 info.allowsContinuation = (ret.readUnsignedByte() == 1);
370
371 ret.readUnsignedByte();
372 int m = ret.readInt();
373 while (m-- > 0) {
374 info.continuationLanes.push_back(ret.readString());
375 }
376 result.push_back(info);
377 }
378 return result;
379}
380
381
382std::vector<libsumo::TraCINextTLSData>
383Vehicle::getNextTLS(const std::string& vehID) {
384 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
385 std::vector<libsumo::TraCINextTLSData> result;
387 ret.readInt(); // components
388 // number of items
389 ret.readUnsignedByte();
390 const int n = ret.readInt();
391 for (int i = 0; i < n; ++i) {
393 ret.readUnsignedByte();
394 d.id = ret.readString();
395
396 ret.readUnsignedByte();
397 d.tlIndex = ret.readInt();
398
399 ret.readUnsignedByte();
400 d.dist = ret.readDouble();
401
402 ret.readUnsignedByte();
403 d.state = (char)ret.readByte();
404
405 result.push_back(d);
406 }
407 return result;
408}
409
410std::vector<libsumo::TraCINextStopData>
411Vehicle::getNextStops(const std::string& vehID) {
412 return getStops(vehID, 0);
413}
414
415std::vector<libsumo::TraCIConnection>
416Vehicle::getNextLinks(const std::string& vehID) {
417 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
418 std::vector<libsumo::TraCIConnection> result;
420 ret.readInt(); // components
421 // number of items
422 ret.readUnsignedByte();
423
424 const int linkNo = ret.readInt();
425 for (int i = 0; i < linkNo; ++i) {
429 con.hasPrio = StoHelp::readBool(ret);
430 con.isOpen = StoHelp::readBool(ret);
431 con.hasFoe = StoHelp::readBool(ret);
435 result.emplace_back(con);
436 }
437 return result;
438}
439
440std::vector<libsumo::TraCINextStopData>
441Vehicle::getStops(const std::string& vehID, int limit) {
442 std::vector<libsumo::TraCINextStopData> result;
443 tcpip::Storage content;
444 StoHelp::writeTypedInt(content, limit);
445 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
446 tcpip::Storage& ret = Dom::get(libsumo::VAR_NEXT_STOPS2, vehID, &content);
447 ret.readInt(); // components
448 // number of items
449 const int n = StoHelp::readCompound(ret);
450 for (int i = 0; i < n; ++i) {
468 result.emplace_back(s);
469 }
470 return result;
471}
472
473std::string
474Vehicle::getStopParameter(const std::string& vehID, int nextStopIndex, const std::string& param, bool customParam) {
475 tcpip::Storage content;
476 StoHelp::writeCompound(content, 3);
477 StoHelp::writeTypedInt(content, nextStopIndex);
478 StoHelp::writeTypedString(content, param);
479 StoHelp::writeTypedByte(content, customParam);
480 return Dom::getString(libsumo::VAR_STOP_PARAMETER, vehID, &content);
481}
482
483int
484Vehicle::getStopState(const std::string& vehID) {
485 return Dom::getInt(libsumo::VAR_STOPSTATE, vehID);
486}
487
488
489double
490Vehicle::getDistance(const std::string& vehID) {
492}
493
494
495double
496Vehicle::getDrivingDistance(const std::string& vehID, const std::string& edgeID, double pos, int laneIndex) {
497 tcpip::Storage content;
498 StoHelp::writeCompound(content, 2);
500 content.writeString(edgeID);
501 content.writeDouble(pos);
502 content.writeUnsignedByte(laneIndex);
504 return Dom::getDouble(libsumo::DISTANCE_REQUEST, vehID, &content);
505}
506
507
508double
509Vehicle::getDrivingDistance2D(const std::string& vehID, double x, double y) {
510 tcpip::Storage content;
511 StoHelp::writeCompound(content, 2);
513 content.writeDouble(x);
514 content.writeDouble(y);
516 return Dom::getDouble(libsumo::DISTANCE_REQUEST, vehID, &content);
517}
518
519
520double
521Vehicle::getAllowedSpeed(const std::string& vehID) {
523}
524
525
526double
527Vehicle::getSpeedFactor(const std::string& vehID) {
529}
530
531
532int
533Vehicle::getSpeedMode(const std::string& vehID) {
535}
536
537
538int
539Vehicle::getLaneChangeMode(const std::string& vehID) {
541}
542
543
544int
545Vehicle::getRoutingMode(const std::string& vehID) {
547}
548
549
550std::string
551Vehicle::getLine(const std::string& vehID) {
552 return Dom::getString(libsumo::VAR_LINE, vehID);
553}
554
555
556
557std::vector<std::string>
558Vehicle::getVia(const std::string& vehID) {
560}
561
562
563std::pair<int, int>
564Vehicle::getLaneChangeState(const std::string& vehID, int direction) {
565 tcpip::Storage content;
566 StoHelp::writeTypedInt(content, direction);
567 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
568 tcpip::Storage& ret = Dom::get(libsumo::CMD_CHANGELANE, vehID, &content);
569 ret.readInt(); // components
570 ret.readUnsignedByte();
571 const int stateWithoutTraCI = ret.readInt();
572 ret.readUnsignedByte();
573 const int state = ret.readInt();
574 return std::make_pair(stateWithoutTraCI, state);
575}
576
577
578std::vector<std::pair<std::string, double> >
579Vehicle::getNeighbors(const std::string& vehID, const int mode) {
580 std::vector<std::pair<std::string, double> > neighs;
581 tcpip::Storage content;
583 content.writeUnsignedByte(mode);
584 std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
585 tcpip::Storage& ret = Dom::get(libsumo::VAR_NEIGHBORS, vehID, &content);
586 const int items = ret.readInt(); // components
587 for (int i = 0; i < items; i++) {
588 const std::string neighID = ret.readString();
589 neighs.emplace_back(neighID, ret.readDouble());
590 }
591 return neighs;
592}
593
594
595double
596Vehicle::getFollowSpeed(const std::string& vehID, double speed, double gap, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) {
597 tcpip::Storage content;
598 StoHelp::writeCompound(content, 5);
599 StoHelp::writeTypedDouble(content, speed);
600 StoHelp::writeTypedDouble(content, gap);
601 StoHelp::writeTypedDouble(content, leaderSpeed);
602 StoHelp::writeTypedDouble(content, leaderMaxDecel);
603 StoHelp::writeTypedString(content, leaderID);
604 return Dom::getDouble(libsumo::VAR_FOLLOW_SPEED, vehID, &content);
605}
606
607
608double
609Vehicle::getSecureGap(const std::string& vehID, double speed, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) {
610 tcpip::Storage content;
611 StoHelp::writeCompound(content, 4);
612 StoHelp::writeTypedDouble(content, speed);
613 StoHelp::writeTypedDouble(content, leaderSpeed);
614 StoHelp::writeTypedDouble(content, leaderMaxDecel);
615 StoHelp::writeTypedString(content, leaderID);
616 return Dom::getDouble(libsumo::VAR_SECURE_GAP, vehID, &content);
617}
618
619
620double
621Vehicle::getStopSpeed(const std::string& vehID, const double speed, double gap) {
622 tcpip::Storage content;
623 StoHelp::writeCompound(content, 2);
624 StoHelp::writeTypedDouble(content, speed);
625 StoHelp::writeTypedDouble(content, gap);
626 return Dom::getDouble(libsumo::VAR_STOP_SPEED, vehID, &content);
627}
628
629double
630Vehicle::getStopDelay(const std::string& vehID) {
632}
633
634double
635Vehicle::getStopArrivalDelay(const std::string& vehID) {
637}
638
639double
640Vehicle::getTimeLoss(const std::string& vehID) {
642}
643
644std::vector<std::string>
645Vehicle::getTaxiFleet(int taxiState) {
646 tcpip::Storage content;
647 StoHelp::writeTypedInt(content, taxiState);
648 return Dom::getStringVector(libsumo::VAR_TAXI_FLEET, "", &content);
649}
650
651std::vector<std::string>
652Vehicle::getLoadedIDList() {
654}
655
656std::vector<std::string>
657Vehicle::getTeleportingIDList() {
659}
660
661std::string
662Vehicle::getEmissionClass(const std::string& vehID) {
664}
665
666std::string
667Vehicle::getShapeClass(const std::string& vehID) {
669}
670
671
672double
673Vehicle::getLength(const std::string& vehID) {
674 return Dom::getDouble(libsumo::VAR_LENGTH, vehID);
675}
676
677
678double
679Vehicle::getAccel(const std::string& vehID) {
680 return Dom::getDouble(libsumo::VAR_ACCEL, vehID);
681}
682
683
684double
685Vehicle::getDecel(const std::string& vehID) {
686 return Dom::getDouble(libsumo::VAR_DECEL, vehID);
687}
688
689
690double Vehicle::getEmergencyDecel(const std::string& vehID) {
692}
693
694
695double Vehicle::getApparentDecel(const std::string& vehID) {
697}
698
699
700double Vehicle::getActionStepLength(const std::string& vehID) {
702}
703
704
705double Vehicle::getLastActionTime(const std::string& vehID) {
707}
708
709
710double
711Vehicle::getTau(const std::string& vehID) {
712 return Dom::getDouble(libsumo::VAR_TAU, vehID);
713}
714
715
716double
717Vehicle::getImperfection(const std::string& vehID) {
719}
720
721
722double
723Vehicle::getSpeedDeviation(const std::string& vehID) {
725}
726
727
728std::string
729Vehicle::getVehicleClass(const std::string& vehID) {
731}
732
733
734double
735Vehicle::getMinGap(const std::string& vehID) {
736 return Dom::getDouble(libsumo::VAR_MINGAP, vehID);
737}
738
739
740double
741Vehicle::getMinGapLat(const std::string& vehID) {
743}
744
745
746double
747Vehicle::getMaxSpeed(const std::string& vehID) {
749}
750
751
752double
753Vehicle::getMaxSpeedLat(const std::string& vehID) {
755}
756
757
758std::string
759Vehicle::getLateralAlignment(const std::string& vehID) {
761}
762
763
764double
765Vehicle::getWidth(const std::string& vehID) {
766 return Dom::getDouble(libsumo::VAR_WIDTH, vehID);
767}
768
769
770double
771Vehicle::getHeight(const std::string& vehID) {
772 return Dom::getDouble(libsumo::VAR_HEIGHT, vehID);
773}
774
775
776double
777Vehicle::getMass(const std::string& vehID) {
778 return Dom::getDouble(libsumo::VAR_MASS, vehID);
779}
780
781
782void
783Vehicle::setStop(const std::string& vehID,
784 const std::string& edgeID,
785 double pos,
786 int laneIndex,
787 double duration,
788 int flags,
789 double startPos,
790 double until) {
791 tcpip::Storage content;
792 StoHelp::writeCompound(content, 7);
793 StoHelp::writeTypedString(content, edgeID);
794 StoHelp::writeTypedDouble(content, pos);
795 StoHelp::writeTypedByte(content, laneIndex);
796 StoHelp::writeTypedDouble(content, duration);
797 StoHelp::writeTypedByte(content, flags);
798 StoHelp::writeTypedDouble(content, startPos);
799 StoHelp::writeTypedDouble(content, until);
800 Dom::set(libsumo::CMD_STOP, vehID, &content);
801}
802
803
804void
805Vehicle::replaceStop(const std::string& vehID,
806 int nextStopIndex,
807 const std::string& edgeID,
808 double pos,
809 int laneIndex,
810 double duration,
811 int flags,
812 double startPos,
813 double until,
814 int teleport) {
815 tcpip::Storage content;
816 StoHelp::writeCompound(content, 9);
817 StoHelp::writeTypedString(content, edgeID);
818 StoHelp::writeTypedDouble(content, pos);
819 StoHelp::writeTypedByte(content, laneIndex);
820 StoHelp::writeTypedDouble(content, duration);
821 StoHelp::writeTypedInt(content, flags);
822 StoHelp::writeTypedDouble(content, startPos);
823 StoHelp::writeTypedDouble(content, until);
824 StoHelp::writeTypedInt(content, nextStopIndex);
825 StoHelp::writeTypedByte(content, teleport);
826 Dom::set(libsumo::CMD_REPLACE_STOP, vehID, &content);
827}
828
829
830void
831Vehicle::insertStop(const std::string& vehID,
832 int nextStopIndex,
833 const std::string& edgeID,
834 double pos,
835 int laneIndex,
836 double duration,
837 int flags,
838 double startPos,
839 double until,
840 int teleport) {
841 tcpip::Storage content;
842 StoHelp::writeCompound(content, 9);
843 StoHelp::writeTypedString(content, edgeID);
844 StoHelp::writeTypedDouble(content, pos);
845 StoHelp::writeTypedByte(content, laneIndex);
846 StoHelp::writeTypedDouble(content, duration);
847 StoHelp::writeTypedInt(content, flags);
848 StoHelp::writeTypedDouble(content, startPos);
849 StoHelp::writeTypedDouble(content, until);
850 StoHelp::writeTypedInt(content, nextStopIndex);
851 StoHelp::writeTypedByte(content, teleport);
852 Dom::set(libsumo::CMD_INSERT_STOP, vehID, &content);
853}
854
855
856void
857Vehicle::setStopParameter(const std::string& vehID, int nextStopIndex,
858 const std::string& param, const std::string& value,
859 bool customParam) {
860 tcpip::Storage content;
861 StoHelp::writeCompound(content, 4);
862 StoHelp::writeTypedInt(content, nextStopIndex);
863 StoHelp::writeTypedString(content, param);
864 StoHelp::writeTypedString(content, value);
865 StoHelp::writeTypedByte(content, customParam);
866 Dom::set(libsumo::VAR_STOP_PARAMETER, vehID, &content);
867}
868
869
870void
871Vehicle::rerouteParkingArea(const std::string& vehID, const std::string& parkingAreaID) {
872 tcpip::Storage content;
873 StoHelp::writeCompound(content, 1);
874 StoHelp::writeTypedString(content, parkingAreaID);
876}
877
878
879void
880Vehicle::resume(const std::string& vehID) {
881 tcpip::Storage content;
882 StoHelp::writeCompound(content, 0);
883 Dom::set(libsumo::CMD_RESUME, vehID, &content);
884}
885
886
887void
888Vehicle::changeTarget(const std::string& vehID, const std::string& edgeID) {
890}
891
892
893void
894Vehicle::changeLane(const std::string& vehID, int laneIndex, double duration) {
895 tcpip::Storage content;
896 StoHelp::writeCompound(content, 2);
897 StoHelp::writeTypedByte(content, laneIndex);
898 StoHelp::writeTypedDouble(content, duration);
899 Dom::set(libsumo::CMD_CHANGELANE, vehID, &content);
900}
901
902void
903Vehicle::changeLaneRelative(const std::string& vehID, int indexOffset, double duration) {
904 tcpip::Storage content;
905 StoHelp::writeCompound(content, 3);
906 StoHelp::writeTypedByte(content, indexOffset);
907 StoHelp::writeTypedDouble(content, duration);
908 StoHelp::writeTypedByte(content, 1);
909 Dom::set(libsumo::CMD_CHANGELANE, vehID, &content);
910}
911
912
913void
914Vehicle::changeSublane(const std::string& vehID, double latDist) {
916}
917
918
919void
920Vehicle::add(const std::string& vehID,
921 const std::string& routeID,
922 const std::string& typeID,
923 const std::string& depart,
924 const std::string& departLane,
925 const std::string& departPos,
926 const std::string& departSpeed,
927 const std::string& arrivalLane,
928 const std::string& arrivalPos,
929 const std::string& arrivalSpeed,
930 const std::string& fromTaz,
931 const std::string& toTaz,
932 const std::string& line,
933 int personCapacity,
934 int personNumber) {
935 tcpip::Storage content;
936 StoHelp::writeCompound(content, 14);
937 StoHelp::writeTypedString(content, routeID);
938 StoHelp::writeTypedString(content, typeID);
939 StoHelp::writeTypedString(content, depart);
940 StoHelp::writeTypedString(content, departLane);
941 StoHelp::writeTypedString(content, departPos);
942 StoHelp::writeTypedString(content, departSpeed);
943
944 StoHelp::writeTypedString(content, arrivalLane);
945 StoHelp::writeTypedString(content, arrivalPos);
946 StoHelp::writeTypedString(content, arrivalSpeed);
947
948 StoHelp::writeTypedString(content, fromTaz);
949 StoHelp::writeTypedString(content, toTaz);
950 StoHelp::writeTypedString(content, line);
951
952 StoHelp::writeTypedInt(content, personCapacity);
953 StoHelp::writeTypedInt(content, personNumber);
954
955 Dom::set(libsumo::ADD_FULL, vehID, &content);
956}
957
958
959void
960Vehicle::moveToXY(const std::string& vehID, const std::string& edgeID, const int laneIndex,
961 const double x, const double y, double angle, const int keepRoute, double matchThreshold) {
962 tcpip::Storage content;
963 StoHelp::writeCompound(content, 7);
964 StoHelp::writeTypedString(content, edgeID);
965 StoHelp::writeTypedInt(content, laneIndex);
966 StoHelp::writeTypedDouble(content, x);
967 StoHelp::writeTypedDouble(content, y);
968 StoHelp::writeTypedDouble(content, angle);
969 StoHelp::writeTypedByte(content, keepRoute);
970 StoHelp::writeTypedDouble(content, matchThreshold);
971 Dom::set(libsumo::MOVE_TO_XY, vehID, &content);
972}
973
974void
975Vehicle::slowDown(const std::string& vehID, double speed, double duration) {
976 tcpip::Storage content;
977 StoHelp::writeCompound(content, 2);
978 StoHelp::writeTypedDouble(content, speed);
979 StoHelp::writeTypedDouble(content, duration);
980 Dom::set(libsumo::CMD_SLOWDOWN, vehID, &content);
981}
982
983void
984Vehicle::openGap(const std::string& vehID, double newTimeHeadway, double newSpaceHeadway, double duration, double changeRate, double maxDecel, const std::string& referenceVehID) {
985 tcpip::Storage content;
986 StoHelp::writeCompound(content, referenceVehID != "" ? 6 : 5);
987 StoHelp::writeTypedDouble(content, newTimeHeadway);
988 StoHelp::writeTypedDouble(content, newSpaceHeadway);
989 StoHelp::writeTypedDouble(content, duration);
990 StoHelp::writeTypedDouble(content, changeRate);
991 StoHelp::writeTypedDouble(content, maxDecel);
992 if (referenceVehID != "") {
993 StoHelp::writeTypedString(content, referenceVehID);
994 }
995 Dom::set(libsumo::CMD_OPENGAP, vehID, &content);
996}
997
998void
999Vehicle::deactivateGapControl(const std::string& vehID) {
1000 openGap(vehID, -1, -1, -1, -1);
1001}
1002
1003void
1004Vehicle::requestToC(const std::string& vehID, double leadTime) {
1005 std::ostringstream oss;
1006 oss.setf(std::ios::fixed, std::ios::floatfield);
1007 oss << std::setprecision(2);
1008 oss << leadTime;
1009 setParameter(vehID, "device.toc.requestToC", oss.str());
1010}
1011
1012void
1013Vehicle::setSpeed(const std::string& vehID, double speed) {
1014 Dom::setDouble(libsumo::VAR_SPEED, vehID, speed);
1015}
1016
1017void
1018Vehicle::setAcceleration(const std::string& vehID, double acceleration, double duration) {
1019 tcpip::Storage content;
1020 StoHelp::writeCompound(content, 2);
1021 StoHelp::writeTypedDouble(content, acceleration);
1022 StoHelp::writeTypedDouble(content, duration);
1023 Dom::set(libsumo::VAR_ACCELERATION, vehID, &content);
1024}
1025
1026void
1027Vehicle::setPreviousSpeed(const std::string& vehID, double prevSpeed, double prevAcceleration) {
1028 tcpip::Storage content;
1029 StoHelp::writeCompound(content, 2);
1030 StoHelp::writeTypedDouble(content, prevSpeed);
1031 StoHelp::writeTypedDouble(content, prevAcceleration);
1032 Dom::set(libsumo::VAR_PREV_SPEED, vehID, &content);
1033}
1034
1035void
1036Vehicle::setSpeedMode(const std::string& vehID, int speedMode) {
1037 Dom::setInt(libsumo::VAR_SPEEDSETMODE, vehID, speedMode);
1038}
1039
1040void
1041Vehicle::setLaneChangeMode(const std::string& vehID, int laneChangeMode) {
1042 Dom::setInt(libsumo::VAR_LANECHANGE_MODE, vehID, laneChangeMode);
1043}
1044
1045void
1046Vehicle::setRoutingMode(const std::string& vehID, int routingMode) {
1047 Dom::setInt(libsumo::VAR_ROUTING_MODE, vehID, routingMode);
1048}
1049
1050void
1051Vehicle::setType(const std::string& vehID, const std::string& typeID) {
1052 Dom::setString(libsumo::VAR_TYPE, vehID, typeID);
1053}
1054
1055void
1056Vehicle::setRouteID(const std::string& vehID, const std::string& routeID) {
1057 Dom::setString(libsumo::VAR_ROUTE_ID, vehID, routeID);
1058}
1059
1060void
1061Vehicle::setRoute(const std::string& vehID, const std::string& edgeID) {
1062 setRoute(vehID, std::vector<std::string>({edgeID}));
1063}
1064
1065void
1066Vehicle::setRoute(const std::string& vehID, const std::vector<std::string>& edgeIDs) {
1068}
1069
1070void
1071Vehicle::setLateralLanePosition(const std::string& vehID, double posLat) {
1073}
1074
1075void
1076Vehicle::updateBestLanes(const std::string& vehID) {
1077 tcpip::Storage content;
1078 Dom::set(libsumo::VAR_UPDATE_BESTLANES, vehID, &content);
1079}
1080
1081
1082void
1083Vehicle::setAdaptedTraveltime(const std::string& vehID, const std::string& edgeID,
1084 double time, double begSeconds, double endSeconds) {
1085 tcpip::Storage content;
1086 if (time == libsumo::INVALID_DOUBLE_VALUE) {
1087 // reset
1088 StoHelp::writeCompound(content, 1);
1089 StoHelp::writeTypedString(content, edgeID);
1090 } else if (begSeconds == libsumo::INVALID_DOUBLE_VALUE) {
1091 // set value for the whole simulation
1092 StoHelp::writeCompound(content, 2);
1093 StoHelp::writeTypedString(content, edgeID);
1094 StoHelp::writeTypedDouble(content, time);
1095 } else {
1096 StoHelp::writeCompound(content, 4);
1097 StoHelp::writeTypedDouble(content, begSeconds);
1098 StoHelp::writeTypedDouble(content, endSeconds);
1099 StoHelp::writeTypedString(content, edgeID);
1100 StoHelp::writeTypedDouble(content, time);
1101 }
1102 Dom::set(libsumo::VAR_EDGE_TRAVELTIME, vehID, &content);
1103}
1104
1105
1106void
1107Vehicle::setEffort(const std::string& vehID, const std::string& edgeID,
1108 double effort, double begSeconds, double endSeconds) {
1109 tcpip::Storage content;
1110 if (effort == libsumo::INVALID_DOUBLE_VALUE) {
1111 // reset
1112 StoHelp::writeCompound(content, 1);
1113 StoHelp::writeTypedString(content, edgeID);
1114 } else if (begSeconds == libsumo::INVALID_DOUBLE_VALUE) {
1115 // set value for the whole simulation
1116 StoHelp::writeCompound(content, 2);
1117 StoHelp::writeTypedString(content, edgeID);
1118 StoHelp::writeTypedDouble(content, effort);
1119 } else {
1120 StoHelp::writeCompound(content, 4);
1121 StoHelp::writeTypedDouble(content, begSeconds);
1122 StoHelp::writeTypedDouble(content, endSeconds);
1123 StoHelp::writeTypedString(content, edgeID);
1124 StoHelp::writeTypedDouble(content, effort);
1125 }
1126 Dom::set(libsumo::VAR_EDGE_EFFORT, vehID, &content);
1127}
1128
1129
1130void
1131Vehicle::rerouteTraveltime(const std::string& vehID, const bool /* currentTravelTimes */) {
1132 tcpip::Storage content;
1133 StoHelp::writeCompound(content, 0);
1134 Dom::set(libsumo::CMD_REROUTE_TRAVELTIME, vehID, &content);
1135}
1136
1137
1138void
1139Vehicle::rerouteEffort(const std::string& vehID) {
1140 tcpip::Storage content;
1141 StoHelp::writeCompound(content, 0);
1142 Dom::set(libsumo::CMD_REROUTE_EFFORT, vehID, &content);
1143}
1144
1145
1146void
1147Vehicle::setSignals(const std::string& vehID, int signals) {
1148 Dom::setInt(libsumo::VAR_SIGNALS, vehID, signals);
1149}
1150
1151
1152void
1153Vehicle::moveTo(const std::string& vehID, const std::string& laneID, double pos, int reason) {
1154 tcpip::Storage content;
1155 StoHelp::writeCompound(content, 3);
1156 StoHelp::writeTypedString(content, laneID);
1157 StoHelp::writeTypedDouble(content, pos);
1158 StoHelp::writeTypedInt(content, reason);
1159 Dom::set(libsumo::VAR_MOVE_TO, vehID, &content);
1160}
1161
1162
1163void
1164Vehicle::setActionStepLength(const std::string& vehID, double actionStepLength, bool resetActionOffset) {
1165 //if (actionStepLength < 0) {
1166 // raise TraCIException("Invalid value for actionStepLength. Given value must be non-negative.")
1167 //{
1168 // Use negative value to indicate resetActionOffset == False
1169 if (!resetActionOffset) {
1170 actionStepLength *= -1;
1171 }
1172 Dom::setDouble(libsumo::VAR_ACTIONSTEPLENGTH, vehID, actionStepLength);
1173}
1174
1175
1176void
1177Vehicle::remove(const std::string& vehID, char reason) {
1178 tcpip::Storage content;
1180 content.writeUnsignedByte(reason);
1181 Dom::set(libsumo::REMOVE, vehID, &content);
1182}
1183
1184
1185void
1186Vehicle::setColor(const std::string& vehID, const libsumo::TraCIColor& color) {
1187 Dom::setCol(libsumo::VAR_COLOR, vehID, color);
1188}
1189
1190
1191void
1192Vehicle::setSpeedFactor(const std::string& vehID, double factor) {
1194}
1195
1196
1197void
1198Vehicle::setLine(const std::string& vehID, const std::string& line) {
1199 Dom::setString(libsumo::VAR_LINE, vehID, line);
1200}
1201
1202
1203void
1204Vehicle::setVia(const std::string& vehID, const std::vector<std::string>& edgeList) {
1205 Dom::setStringVector(libsumo::VAR_VIA, vehID, edgeList);
1206}
1207
1208
1209void
1210Vehicle::setLength(const std::string& vehID, double length) {
1211 Dom::setDouble(libsumo::VAR_LENGTH, vehID, length);
1212}
1213
1214
1215void
1216Vehicle::setMaxSpeed(const std::string& vehID, double speed) {
1218}
1219
1220
1221void
1222Vehicle::setVehicleClass(const std::string& vehID, const std::string& clazz) {
1224}
1225
1226
1227void
1228Vehicle::setShapeClass(const std::string& vehID, const std::string& clazz) {
1230}
1231
1232
1233void
1234Vehicle::setEmissionClass(const std::string& vehID, const std::string& clazz) {
1236}
1237
1238
1239void
1240Vehicle::setWidth(const std::string& vehID, double width) {
1241 Dom::setDouble(libsumo::VAR_WIDTH, vehID, width);
1242}
1243
1244
1245void
1246Vehicle::setHeight(const std::string& vehID, double height) {
1247 Dom::setDouble(libsumo::VAR_HEIGHT, vehID, height);
1248}
1249
1250
1251void
1252Vehicle::setMass(const std::string& vehID, double mass) {
1253 Dom::setDouble(libsumo::VAR_MASS, vehID, mass);
1254}
1255
1256
1257void
1258Vehicle::setMinGap(const std::string& vehID, double minGap) {
1259 Dom::setDouble(libsumo::VAR_MINGAP, vehID, minGap);
1260}
1261
1262
1263void
1264Vehicle::setAccel(const std::string& vehID, double accel) {
1265 Dom::setDouble(libsumo::VAR_ACCEL, vehID, accel);
1266}
1267
1268
1269void
1270Vehicle::setDecel(const std::string& vehID, double decel) {
1271 Dom::setDouble(libsumo::VAR_DECEL, vehID, decel);
1272}
1273
1274
1275void
1276Vehicle::setEmergencyDecel(const std::string& vehID, double decel) {
1278}
1279
1280
1281void
1282Vehicle::setApparentDecel(const std::string& vehID, double decel) {
1284}
1285
1286
1287void
1288Vehicle::setImperfection(const std::string& vehID, double imperfection) {
1289 Dom::setDouble(libsumo::VAR_IMPERFECTION, vehID, imperfection);
1290}
1291
1292
1293void
1294Vehicle::setTau(const std::string& vehID, double tau) {
1295 Dom::setDouble(libsumo::VAR_TAU, vehID, tau);
1296}
1297
1298
1299void
1300Vehicle::setMinGapLat(const std::string& vehID, double minGapLat) {
1301 Dom::setDouble(libsumo::VAR_MINGAP_LAT, vehID, minGapLat);
1302}
1303
1304
1305void
1306Vehicle::setMaxSpeedLat(const std::string& vehID, double speed) {
1308}
1309
1310
1311void
1312Vehicle::setLateralAlignment(const std::string& vehID, const std::string& latAlignment) {
1313 Dom::setString(libsumo::VAR_LATALIGNMENT, vehID, latAlignment);
1314}
1315
1316
1317void
1318Vehicle::setImpatience(const std::string& vehID, double impatience) {
1319 Dom::setDouble(libsumo::VAR_IMPATIENCE, vehID, impatience);
1320}
1321
1322void
1323Vehicle::setBoardingDuration(const std::string& vehID, double boardingDuration) {
1324 Dom::setDouble(libsumo::VAR_BOARDING_DURATION, vehID, boardingDuration);
1325}
1326
1327
1328void
1329Vehicle::highlight(const std::string& vehID, const libsumo::TraCIColor& col, double size, const int alphaMax, const double duration, const int type) {
1330 tcpip::Storage content;
1331 StoHelp::writeCompound(content, alphaMax > 0 ? 5 : 2);
1333 content.writeUnsignedByte(col.r);
1334 content.writeUnsignedByte(col.g);
1335 content.writeUnsignedByte(col.b);
1336 content.writeUnsignedByte(col.a);
1337 StoHelp::writeTypedDouble(content, size);
1338 if (alphaMax > 0) {
1340 content.writeUnsignedByte(alphaMax);
1341 StoHelp::writeTypedDouble(content, duration);
1343 content.writeUnsignedByte(type);
1344 }
1345 Dom::set(libsumo::VAR_HIGHLIGHT, vehID, &content);
1346}
1347
1348void
1349Vehicle::dispatchTaxi(const std::string& vehID, const std::vector<std::string>& reservations) {
1351}
1352
1353
1354void
1355Vehicle::subscribeLeader(const std::string& vehID, double dist, double begin, double end) {
1356 subscribe(vehID, std::vector<int>({ libsumo::VAR_LEADER }), begin, end,
1357 libsumo::TraCIResults({ {libsumo::VAR_LEADER, std::make_shared<libsumo::TraCIDouble>(dist)} }));
1358}
1359
1360
1361void
1362Vehicle::addSubscriptionFilterLanes(const std::vector<int>& lanes, bool noOpposite, double downstreamDist, double upstreamDist) {
1363 tcpip::Storage content;
1364 content.writeUnsignedByte((int)lanes.size());
1365 for (int lane : lanes) {
1366 content.writeUnsignedByte(lane < 0 ? lane + 256 : lane);
1367 }
1369 if (noOpposite) {
1370 addSubscriptionFilterNoOpposite();
1371 }
1372 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1373 addSubscriptionFilterDownstreamDistance(downstreamDist);
1374 }
1375 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1376 addSubscriptionFilterUpstreamDistance(upstreamDist);
1377 }
1378}
1379
1380
1381void
1382Vehicle::addSubscriptionFilterNoOpposite() {
1384}
1385
1386
1387void
1388Vehicle::addSubscriptionFilterDownstreamDistance(double dist) {
1389 tcpip::Storage content;
1390 StoHelp::writeTypedDouble(content, dist);
1392}
1393
1394
1395void
1396Vehicle::addSubscriptionFilterUpstreamDistance(double dist) {
1397 tcpip::Storage content;
1398 StoHelp::writeTypedDouble(content, dist);
1400}
1401
1402
1403void
1404Vehicle::addSubscriptionFilterCFManeuver(double downstreamDist, double upstreamDist) {
1405 addSubscriptionFilterLeadFollow(std::vector<int>(1));
1406 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1407 addSubscriptionFilterDownstreamDistance(downstreamDist);
1408 }
1409 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1410 addSubscriptionFilterUpstreamDistance(upstreamDist);
1411 }
1412}
1413
1414
1415void
1416Vehicle::addSubscriptionFilterLCManeuver(int direction, bool noOpposite, double downstreamDist, double upstreamDist) {
1417 if (direction == libsumo::INVALID_INT_VALUE) {
1418 addSubscriptionFilterLeadFollow({ -1, 0, 1 });
1419 } else if (direction != -1 && direction != 1) {
1420 // warnings.warn("Ignoring lane change subscription filter with non-neighboring lane offset direction=%s." % direction)
1421 return;
1422 } else {
1423 addSubscriptionFilterLeadFollow({ 0, direction });
1424 }
1425 if (noOpposite) {
1426 addSubscriptionFilterNoOpposite();
1427 }
1428 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1429 addSubscriptionFilterDownstreamDistance(downstreamDist);
1430 }
1431 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1432 addSubscriptionFilterUpstreamDistance(upstreamDist);
1433 }
1434}
1435
1436
1437void
1438Vehicle::addSubscriptionFilterLeadFollow(const std::vector<int>& lanes) {
1440 addSubscriptionFilterLanes(lanes);
1441}
1442
1443
1444void
1445Vehicle::addSubscriptionFilterTurn(double downstreamDist, double foeDistToJunction) {
1446 tcpip::Storage content;
1447 StoHelp::writeTypedDouble(content, foeDistToJunction);
1449 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1450 addSubscriptionFilterDownstreamDistance(downstreamDist);
1451 }
1452}
1453
1454
1455void
1456Vehicle::addSubscriptionFilterVClass(const std::vector<std::string>& vClasses) {
1457 tcpip::Storage content;
1458 StoHelp::writeTypedStringList(content, vClasses);
1460}
1461
1462
1463void
1464Vehicle::addSubscriptionFilterVType(const std::vector<std::string>& vTypes) {
1465 tcpip::Storage content;
1466 StoHelp::writeTypedStringList(content, vTypes);
1468}
1469
1470
1471void
1472Vehicle::addSubscriptionFilterFieldOfVision(double openingAngle) {
1473 tcpip::Storage content;
1474 StoHelp::writeTypedDouble(content, openingAngle);
1476}
1477
1478
1479void
1480Vehicle::addSubscriptionFilterLateralDistance(double lateralDist, double downstreamDist, double upstreamDist) {
1481 tcpip::Storage content;
1482 StoHelp::writeTypedDouble(content, lateralDist);
1484 if (downstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1485 addSubscriptionFilterDownstreamDistance(downstreamDist);
1486 }
1487 if (upstreamDist != libsumo::INVALID_DOUBLE_VALUE) {
1488 addSubscriptionFilterUpstreamDistance(upstreamDist);
1489 }
1490}
1491
1492
1493}
1494
1495
1496/****************************************************************************/
#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 writeTypedDouble(tcpip::Storage &content, double value)
static int readCompound(tcpip::Storage &ret, int expectedSize=-1, const std::string &error="")
static bool readBool(tcpip::Storage &ret, const std::string &error="")
static int readTypedInt(tcpip::Storage &ret, const std::string &error="")
static void writeCompound(tcpip::Storage &content, int size)
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 double readTypedDouble(tcpip::Storage &ret, const std::string &error="")
std::string approachedLane
Definition TraCIDefs.h:404
std::string approachedInternal
Definition TraCIDefs.h:408
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:231
static libsumo::TraCIPosition getPos(int var, const std::string &id, tcpip::Storage *add=nullptr, const bool isGeo=false)
Definition Domain.h:153
static void setCol(int var, const std::string &id, const libsumo::TraCIColor value)
Definition Domain.h:252
static std::vector< std::string > getStringVector(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition Domain.h:177
static void setStringVector(int var, const std::string &id, const std::vector< std::string > &value)
Definition Domain.h:245
static libsumo::TraCIColor getCol(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition Domain.h:187
static std::string getString(int var, const std::string &id, tcpip::Storage *add=nullptr)
Definition Domain.h:172
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:219
static libsumo::TraCIPosition getPos3D(int var, const std::string &id, tcpip::Storage *add=nullptr, const bool isGeo=false)
Definition Domain.h:162
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:224
static void setString(int var, const std::string &id, const std::string &value)
Definition Domain.h:238
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 int readByte()
Definition storage.cpp:128
virtual double readDouble()
Definition storage.cpp:362
virtual int readInt()
Definition storage.cpp:311
TRACI_CONST double INVALID_DOUBLE_VALUE
TRACI_CONST int VAR_LASTACTIONTIME
TRACI_CONST int TYPE_COLOR
TRACI_CONST int FILTER_TYPE_DOWNSTREAM_DIST
TRACI_CONST int VAR_EDGES
TRACI_CONST int POSITION_ROADMAP
TRACI_CONST int VAR_NOXEMISSION
TRACI_CONST int VAR_LANECHANGE_MODE
TRACI_CONST int LAST_STEP_PERSON_ID_LIST
TRACI_CONST int FILTER_TYPE_NOOPPOSITE
TRACI_CONST int VAR_VEHICLECLASS
TRACI_CONST int TRACI_ID_LIST
TRACI_CONST int VAR_IMPATIENCE
TRACI_CONST int VAR_LATALIGNMENT
TRACI_CONST int VAR_SEGMENT_ID
TRACI_CONST int VAR_TYPE
TRACI_CONST int CMD_CHANGESUBLANE
TRACI_CONST int VAR_DEPARTURE
TRACI_CONST int VAR_ROUTING_MODE
TRACI_CONST int VAR_MINGAP
TRACI_CONST int CMD_TAXI_DISPATCH
TRACI_CONST int VAR_SECURE_GAP
TRACI_CONST int VAR_SHAPECLASS
TRACI_CONST int VAR_WAITING_TIME
TRACI_CONST int CMD_STOP
TRACI_CONST int VAR_LINE
TRACI_CONST int VAR_EDGE_TRAVELTIME
TRACI_CONST int VAR_ROAD_ID
TRACI_CONST int VAR_TIMELOSS
TRACI_CONST int CMD_RESUME
TRACI_CONST int VAR_ACTIONSTEPLENGTH
TRACI_CONST int VAR_SPEED_FACTOR
TRACI_CONST int MOVE_TO_XY
TRACI_CONST int VAR_FOLLOW_SPEED
TRACI_CONST int VAR_STOP_ARRIVALDELAY
TRACI_CONST int VAR_SPEED_LAT
TRACI_CONST int FILTER_TYPE_FIELD_OF_VISION
TRACI_CONST int VAR_ANGLE
TRACI_CONST int VAR_TAU
TRACI_CONST int VAR_NEXT_TLS
TRACI_CONST int VAR_EDGE_EFFORT
TRACI_CONST int VAR_ROUTE
TRACI_CONST int VAR_BEST_LANES
TRACI_CONST int VAR_ALLOWED_SPEED
TRACI_CONST int VAR_LANE_INDEX
TRACI_CONST int VAR_PMXEMISSION
TRACI_CONST int VAR_SPEED_WITHOUT_TRACI
TRACI_CONST int VAR_HIGHLIGHT
TRACI_CONST int VAR_BOARDING_DURATION
TRACI_CONST int TYPE_UBYTE
TRACI_CONST int VAR_MOVE_TO
TRACI_CONST int VAR_PERSON_NUMBER
TRACI_CONST int VAR_COEMISSION
TRACI_CONST int VAR_UPDATE_BESTLANES
TRACI_CONST int VAR_COLOR
TRACI_CONST int VAR_POSITION
TRACI_CONST int VAR_WIDTH
TRACI_CONST int VAR_PERSON_CAPACITY
TRACI_CONST int VAR_STOP_PARAMETER
TRACI_CONST int POSITION_2D
TRACI_CONST int VAR_MAXSPEED
TRACI_CONST int VAR_LEADER
TRACI_CONST int CMD_CHANGETARGET
TRACI_CONST int ADD_FULL
TRACI_CONST int VAR_CO2EMISSION
TRACI_CONST int CMD_REROUTE_TO_PARKING
TRACI_CONST int FILTER_TYPE_VTYPE
TRACI_CONST int VAR_TELEPORTING_LIST
TRACI_CONST int CMD_REROUTE_TRAVELTIME
TRACI_CONST int VAR_TAXI_FLEET
TRACI_CONST int VAR_PREV_SPEED
TRACI_CONST int VAR_ROUTE_VALID
TRACI_CONST int VAR_SPEEDSETMODE
TRACI_CONST int CMD_REPLACE_STOP
TRACI_CONST int VAR_MASS
TRACI_CONST int VAR_FUELCONSUMPTION
TRACI_CONST int VAR_SLOPE
TRACI_CONST int VAR_LENGTH
TRACI_CONST int VAR_MAXSPEED_LAT
TRACI_CONST int CMD_REROUTE_EFFORT
TRACI_CONST int VAR_HCEMISSION
TRACI_CONST int ID_COUNT
TRACI_CONST int VAR_LANEPOSITION
TRACI_CONST int REMOVE
TRACI_CONST int VAR_LANE_ID
TRACI_CONST int CMD_INSERT_STOP
TRACI_CONST int VAR_STOP_SPEED
TRACI_CONST int VAR_IMPERFECTION
TRACI_CONST int VAR_HEIGHT
TRACI_CONST int VAR_APPARENT_DECEL
TRACI_CONST int VAR_NOISEEMISSION
TRACI_CONST int FILTER_TYPE_LEAD_FOLLOW
TRACI_CONST int REQUEST_DRIVINGDIST
TRACI_CONST int VAR_POSITION3D
TRACI_CONST int VAR_SPEED
TRACI_CONST int VAR_DECEL
TRACI_CONST int VAR_SIGNALS
TRACI_CONST int FILTER_TYPE_UPSTREAM_DIST
TRACI_CONST int VAR_ACCUMULATED_WAITING_TIME
TRACI_CONST int VAR_MINGAP_LAT
TRACI_CONST int INVALID_INT_VALUE
TRACI_CONST int VAR_NEXT_LINKS
TRACI_CONST int VAR_ROUTE_INDEX
TRACI_CONST int VAR_NEXT_STOPS2
TRACI_CONST int CMD_SLOWDOWN
TRACI_CONST int FILTER_TYPE_TURN
TRACI_CONST int VAR_ACCELERATION
TRACI_CONST int VAR_ROUTE_ID
TRACI_CONST int DISTANCE_REQUEST
TRACI_CONST int TYPE_BYTE
TRACI_CONST int VAR_SEGMENT_INDEX
TRACI_CONST int CMD_OPENGAP
TRACI_CONST int VAR_LANEPOSITION_LAT
TRACI_CONST int FILTER_TYPE_VCLASS
TRACI_CONST int CMD_CHANGELANE
TRACI_CONST int VAR_STOP_DELAY
TRACI_CONST int VAR_NEIGHBORS
TRACI_CONST int VAR_EMERGENCY_DECEL
TRACI_CONST int VAR_STOPSTATE
TRACI_CONST int VAR_FOLLOWER
TRACI_CONST int VAR_EMISSIONCLASS
TRACI_CONST int VAR_LOADED_LIST
TRACI_CONST int FILTER_TYPE_LANES
TRACI_CONST int VAR_ACCEL
TRACI_CONST int VAR_DEPART_DELAY
std::map< int, std::shared_ptr< libsumo::TraCIResult > > TraCIResults
{variable->value}
Definition TraCIDefs.h:335
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
double length
The length than can be driven from that lane without lane change.
Definition TraCIDefs.h:544
double occupation
The traffic density along length.
Definition TraCIDefs.h:546
bool allowsContinuation
Whether this lane allows continuing the route.
Definition TraCIDefs.h:550
int bestLaneOffset
The offset of this lane from the best lane.
Definition TraCIDefs.h:548
std::vector< std::string > continuationLanes
The sequence of lanes that best allows continuing the route without lane change.
Definition TraCIDefs.h:552
std::string laneID
The id of the lane.
Definition TraCIDefs.h:542
std::string foeId
the id of the vehicle with intersecting trajectory
Definition TraCIDefs.h:679
std::string stoppingPlaceID
Id assigned to the stop.
Definition TraCIDefs.h:493
std::string lane
The lane to stop at.
Definition TraCIDefs.h:487
int stopFlags
Stop flags.
Definition TraCIDefs.h:495
std::string actType
additional information for this stop
Definition TraCIDefs.h:511
std::string tripId
id of the trip within a cyclical public transport route
Definition TraCIDefs.h:513
double startPos
The stopping position start.
Definition TraCIDefs.h:489
double arrival
The actual arrival time (only for past stops)
Definition TraCIDefs.h:503
double depart
The time at which this stop was ended.
Definition TraCIDefs.h:505
std::string join
the id of the vehicle (train portion) to which this vehicle shall be joined
Definition TraCIDefs.h:509
double speed
the speed at which this stop counts as reached (waypoint mode)
Definition TraCIDefs.h:517
double intendedArrival
The intended arrival time.
Definition TraCIDefs.h:501
double endPos
The stopping position end.
Definition TraCIDefs.h:491
std::string split
the id of the vehicle (train portion) that splits of upon reaching this stop
Definition TraCIDefs.h:507
std::string line
the new line id of the trip within a cyclical public transport route
Definition TraCIDefs.h:515
double duration
The intended (minimum) stopping duration.
Definition TraCIDefs.h:497
double until
The time at which the vehicle may continue its journey.
Definition TraCIDefs.h:499
double dist
The distance to the tls.
Definition TraCIDefs.h:436
int tlIndex
The tls index of the controlled link.
Definition TraCIDefs.h:434
std::string id
The id of the next tls.
Definition TraCIDefs.h:432
char state
The current state of the tls.
Definition TraCIDefs.h:438
A 2D or 3D-position, for 2D positions z == INVALID_DOUBLE_VALUE.
Definition TraCIDefs.h:178