52 #define CALL_MICRO_FUN(veh, fun, mesoResult) ((dynamic_cast<MSVehicle*>(veh) == nullptr ? (mesoResult) : dynamic_cast<MSVehicle*>(veh)->fun))
61 #define DEBUG_COND (veh->isSelected())
83 Vehicle::isOnInit(
const std::string& vehicleID) {
85 return sumoVehicle ==
nullptr || sumoVehicle->
getLane() ==
nullptr;
89 std::vector<std::string>
90 Vehicle::getIDList() {
91 std::vector<std::string> ids;
94 if (isVisible((*i).second)) {
95 ids.push_back((*i).first);
102 Vehicle::getIDCount() {
103 return (
int)getIDList().size();
108 Vehicle::getSpeed(
const std::string& vehicleID) {
114 Vehicle::getLateralSpeed(
const std::string& vehicleID) {
121 Vehicle::getAcceleration(
const std::string& vehicleID) {
128 Vehicle::getSpeedWithoutTraCI(
const std::string& vehicleID) {
135 Vehicle::getPosition(
const std::string& vehicleID,
const bool includeZ) {
137 if (isVisible(veh)) {
140 return TraCIPosition();
145 Vehicle::getPosition3D(
const std::string& vehicleID) {
146 return getPosition(vehicleID,
true);
151 Vehicle::getAngle(
const std::string& vehicleID) {
158 Vehicle::getSlope(
const std::string& vehicleID) {
165 Vehicle::getRoadID(
const std::string& vehicleID) {
172 Vehicle::getLaneID(
const std::string& vehicleID) {
179 Vehicle::getLaneIndex(
const std::string& vehicleID) {
186 Vehicle::getTypeID(
const std::string& vehicleID) {
192 Vehicle::getRouteID(
const std::string& vehicleID) {
198 Vehicle::getRouteIndex(
const std::string& vehicleID) {
205 Vehicle::getColor(
const std::string& vehicleID) {
210 Vehicle::getLanePosition(
const std::string& vehicleID) {
216 Vehicle::getLateralLanePosition(
const std::string& vehicleID) {
222 Vehicle::getCO2Emission(
const std::string& vehicleID) {
228 Vehicle::getCOEmission(
const std::string& vehicleID) {
234 Vehicle::getHCEmission(
const std::string& vehicleID) {
240 Vehicle::getPMxEmission(
const std::string& vehicleID) {
246 Vehicle::getNOxEmission(
const std::string& vehicleID) {
252 Vehicle::getFuelConsumption(
const std::string& vehicleID) {
258 Vehicle::getNoiseEmission(
const std::string& vehicleID) {
264 Vehicle::getElectricityConsumption(
const std::string& vehicleID) {
270 Vehicle::getPersonNumber(
const std::string& vehicleID) {
275 Vehicle::getPersonCapacity(
const std::string& vehicleID) {
279 std::vector<std::string>
280 Vehicle::getPersonIDList(
const std::string& vehicleID) {
284 std::pair<std::string, double>
285 Vehicle::getLeader(
const std::string& vehicleID,
double dist) {
288 std::pair<const MSVehicle* const, double> leaderInfo = veh->
getLeader(dist);
289 return std::make_pair(
290 leaderInfo.first !=
nullptr ? leaderInfo.first->getID() :
"",
293 return std::make_pair(
"", -1);
298 std::pair<std::string, double>
299 Vehicle::getFollower(
const std::string& vehicleID,
double dist) {
302 std::pair<const MSVehicle* const, double> leaderInfo = veh->
getFollower(dist);
303 return std::make_pair(
304 leaderInfo.first !=
nullptr ? leaderInfo.first->getID() :
"",
307 return std::make_pair(
"", -1);
313 Vehicle::getWaitingTime(
const std::string& vehicleID) {
319 Vehicle::getAccumulatedWaitingTime(
const std::string& vehicleID) {
326 Vehicle::getAdaptedTraveltime(
const std::string& vehicleID,
double time,
const std::string& edgeID) {
335 Vehicle::getEffort(
const std::string& vehicleID,
double time,
const std::string& edgeID) {
344 Vehicle::isRouteValid(
const std::string& vehicleID) {
350 std::vector<std::string>
351 Vehicle::getRoute(
const std::string& vehicleID) {
352 std::vector<std::string> result;
356 result.push_back((*i)->getID());
363 Vehicle::getSignals(
const std::string& vehicleID) {
369 std::vector<TraCIBestLanesData>
370 Vehicle::getBestLanes(
const std::string& vehicleID) {
371 std::vector<TraCIBestLanesData> result;
373 if (veh !=
nullptr && veh->
isOnRoad()) {
375 TraCIBestLanesData bld;
376 bld.laneID = lq.lane->
getID();
377 bld.length = lq.length;
378 bld.occupation = lq.nextOccupation;
379 bld.bestLaneOffset = lq.bestLaneOffset;
380 bld.allowsContinuation = lq.allowsContinuation;
381 for (
const MSLane*
const lane : lq.bestContinuations) {
382 if (lane !=
nullptr) {
383 bld.continuationLanes.push_back(lane->
getID());
386 result.emplace_back(bld);
393 std::vector<TraCINextTLSData>
394 Vehicle::getNextTLS(
const std::string& vehicleID) {
395 std::vector<TraCINextTLSData> result;
401 if (veh !=
nullptr) {
406 std::vector<MSLink*>::const_iterator linkIt =
MSLane::succLinkSec(*veh, view, *lane, bestLaneConts);
409 if ((*linkIt)->isTLSControlled()) {
410 TraCINextTLSData ntd;
411 ntd.id = (*linkIt)->getTLLogic()->getID();
412 ntd.tlIndex = (*linkIt)->getTLIndex();
414 ntd.state = (char)(*linkIt)->getState();
415 result.push_back(ntd);
418 lane = (*linkIt)->getViaLaneOrLane();
428 for (
int i = 0; i < remainingEdges; i++) {
432 if (allowed !=
nullptr && allowed->size() != 0) {
433 for (
const MSLink*
const link : allowed->front()->getLinkCont()) {
434 if (&link->getLane()->getEdge() == next) {
435 if (link->isTLSControlled()) {
436 TraCINextTLSData ntd;
437 ntd.id = link->getTLLogic()->getID();
438 ntd.tlIndex = link->getTLIndex();
440 ntd.state = (char)link->getState();
441 result.push_back(ntd);
443 seen += allowed->front()->getLength();
457 std::vector<TraCINextStopData>
458 Vehicle::getNextStops(
const std::string& vehicleID) {
459 return getStops(vehicleID, 0);
462 std::vector<TraCINextStopData>
463 Vehicle::getStops(
const std::string& vehicleID,
int limit) {
464 std::vector<TraCINextStopData> result;
468 const std::vector<SUMOVehicleParameter::Stop>& pastStops = vehicle->
getPastStops();
469 const int n = (int)pastStops.size();
470 for (
int i =
MAX2(0, n + limit); i < n; i++) {
471 result.push_back(buildStopData(pastStops[i]));
475 if (!stop.collision) {
476 TraCINextStopData nsd = buildStopData(stop.pars);
480 result.push_back(nsd);
481 if (limit > 0 && (
int)result.size() >= limit) {
492 Vehicle::getStopState(
const std::string& vehicleID) {
495 if (veh ==
nullptr) {
502 result = ((stop.
reached ? 1 : 0) +
506 (stop.
busstop !=
nullptr ? 16 : 0) +
516 Vehicle::getDistance(
const std::string& vehicleID) {
527 Vehicle::getDrivingDistance(
const std::string& vehicleID,
const std::string& edgeID,
double position,
int ) {
534 if (distance == std::numeric_limits<double>::max()) {
545 Vehicle::getDrivingDistance2D(
const std::string& vehicleID,
double x,
double y) {
547 if (veh ==
nullptr) {
554 if (distance == std::numeric_limits<double>::max()) {
565 Vehicle::getAllowedSpeed(
const std::string& vehicleID) {
572 Vehicle::getSpeedFactor(
const std::string& vehicleID) {
578 Vehicle::getSpeedMode(
const std::string& vehicleID) {
585 Vehicle::getLaneChangeMode(
const std::string& vehicleID) {
592 Vehicle::getRoutingMode(
const std::string& vehicleID) {
598 Vehicle::getLine(
const std::string& vehicleID) {
603 std::vector<std::string>
604 Vehicle::getVia(
const std::string& vehicleID) {
610 Vehicle::getLaneChangeState(
const std::string& vehicleID,
int direction) {
613 return veh->
isOnRoad() ?
CALL_MICRO_FUN(veh, getLaneChangeModel().getSavedState(direction), undefined) : undefined;
618 Vehicle::getParameter(
const std::string& vehicleID,
const std::string& key) {
623 throw TraCIException(error);
632 std::vector<std::pair<std::string, double> >
633 Vehicle::getNeighbors(
const std::string& vehicleID,
const int mode) {
634 int dir = (1 & mode) != 0 ? -1 : 1;
635 bool queryLeaders = (2 & mode) != 0;
636 bool blockersOnly = (4 & mode) != 0;
640 std::vector<std::pair<std::string, double> > neighs;
641 if (veh ==
nullptr) {
646 #ifdef DEBUG_NEIGHBORS
648 std::cout <<
"getNeighbors() for veh '" << vehicleID <<
"': dir=" << dir
649 <<
", queryLeaders=" << queryLeaders
650 <<
", blockersOnly=" << blockersOnly << std::endl;
658 bool blocked =
false;
673 #ifdef DEBUG_NEIGHBORS
675 std::cout <<
" blocked=" << blocked << std::endl;
685 const std::shared_ptr<MSLeaderDistanceInfo> res = queryLeaders ? lcm.
getLeaders(dir) : lcm.getFollowers(dir);
686 if (res !=
nullptr && res->hasVehicles()) {
687 auto distIt = begin(res->getDistances());
688 auto vehIt = begin(res->getVehicles());
689 while (distIt != end(res->getDistances())) {
690 if (*vehIt !=
nullptr) {
691 if (neighs.size() == 0 || neighs.back().first != (*vehIt)->getID()) {
692 neighs.push_back(std::make_pair((*vehIt)->getID(), *distIt));
704 Vehicle::getFollowSpeed(
const std::string& vehicleID,
double speed,
double gap,
double leaderSpeed,
double leaderMaxDecel,
const std::string& leaderID) {
707 if (veh ==
nullptr) {
708 WRITE_ERROR(
"getFollowSpeed not applicable for meso");
717 Vehicle::getSecureGap(
const std::string& vehicleID,
double speed,
double leaderSpeed,
double leaderMaxDecel,
const std::string& leaderID) {
720 if (veh ==
nullptr) {
721 WRITE_ERROR(
"getSecureGap not applicable for meso");
730 Vehicle::getStopSpeed(
const std::string& vehicleID,
const double speed,
double gap) {
733 if (veh ==
nullptr) {
734 WRITE_ERROR(
"getStopSpeed not applicable for meso");
741 Vehicle::getStopDelay(
const std::string& vehicleID) {
746 Vehicle::getStopArrivalDelay(
const std::string& vehicleID) {
755 std::vector<std::string>
756 Vehicle::getTaxiFleet(
int taxiState) {
757 std::vector<std::string> result;
759 if (taxi->getHolder().hasDeparted()) {
761 || (taxiState == 0 && taxi->getState() == 0)
762 || (taxiState != 0 && (taxi->getState() & taxiState) == taxiState)) {
763 result.push_back(taxi->getHolder().getID());
771 Vehicle::getEmissionClass(
const std::string& vehicleID) {
776 Vehicle::getShapeClass(
const std::string& vehicleID) {
782 Vehicle::getLength(
const std::string& vehicleID) {
788 Vehicle::getAccel(
const std::string& vehicleID) {
794 Vehicle::getDecel(
const std::string& vehicleID) {
799 double Vehicle::getEmergencyDecel(
const std::string& vehicleID) {
804 double Vehicle::getApparentDecel(
const std::string& vehicleID) {
809 double Vehicle::getActionStepLength(
const std::string& vehicleID) {
814 double Vehicle::getLastActionTime(
const std::string& vehicleID) {
817 if (microVeh !=
nullptr) {
827 Vehicle::getTau(
const std::string& vehicleID) {
833 Vehicle::getImperfection(
const std::string& vehicleID) {
839 Vehicle::getSpeedDeviation(
const std::string& vehicleID) {
845 Vehicle::getVehicleClass(
const std::string& vehicleID) {
851 Vehicle::getMinGap(
const std::string& vehicleID) {
857 Vehicle::getMinGapLat(
const std::string& vehicleID) {
863 Vehicle::getMaxSpeed(
const std::string& vehicleID) {
869 Vehicle::getMaxSpeedLat(
const std::string& vehicleID) {
875 Vehicle::getLateralAlignment(
const std::string& vehicleID) {
881 Vehicle::getWidth(
const std::string& vehicleID) {
887 Vehicle::getHeight(
const std::string& vehicleID) {
893 Vehicle::setStop(
const std::string& vehicleID,
894 const std::string& edgeID,
903 if (veh ==
nullptr) {
908 pos, laneIndex, startPos, flags, duration, until);
911 throw TraCIException(error);
917 Vehicle::replaceStop(
const std::string& vehicleID,
919 const std::string& edgeID,
928 if (veh ==
nullptr) {
933 pos, laneIndex, startPos, flags, duration, until);
936 if (!veh->
replaceStop(nextStopIndex, stopPars,
"traci:replaceStop", error)) {
937 throw TraCIException(
"Stop replacement failed for vehicle '" + vehicleID +
"' (" + error +
").");
943 Vehicle::rerouteParkingArea(
const std::string& vehicleID,
const std::string& parkingAreaID) {
946 if (veh ==
nullptr) {
947 WRITE_WARNING(
"rerouteParkingArea not yet implemented for meso");
953 throw TraCIException(error);
958 Vehicle::resume(
const std::string& vehicleID) {
961 if (veh ==
nullptr) {
966 throw TraCIException(
"Failed to resume vehicle '" + veh->
getID() +
"', it has no stops.");
970 std::ostringstream strs;
971 strs <<
"reached: " << sto.
reached;
972 strs <<
", duration:" << sto.
duration;
973 strs <<
", edge:" << (*sto.
edge)->getID();
975 std::string posStr = strs.str();
976 throw TraCIException(
"Failed to resume from stopping for vehicle '" + veh->
getID() +
"', " + posStr);
982 Vehicle::changeTarget(
const std::string& vehicleID,
const std::string& edgeID) {
985 const bool onInit = isOnInit(vehicleID);
986 if (destEdge ==
nullptr) {
987 throw TraCIException(
"Destination edge '" + edgeID +
"' is not known.");
996 throw TraCIException(
"Route replacement failed for vehicle '" + veh->
getID() +
"'.");
1003 throw TraCIException(e.what());
1009 Vehicle::changeLane(
const std::string& vehicleID,
int laneIndex,
double duration) {
1012 if (veh ==
nullptr) {
1013 WRITE_ERROR(
"changeLane not applicable for meso");
1017 std::vector<std::pair<SUMOTime, int> > laneTimeLine;
1018 laneTimeLine.push_back(std::make_pair(
MSNet::getInstance()->getCurrentTimeStep(), laneIndex));
1024 Vehicle::changeLaneRelative(
const std::string& vehicleID,
int indexOffset,
double duration) {
1027 if (veh ==
nullptr) {
1028 WRITE_ERROR(
"changeLaneRelative not applicable for meso");
1032 std::vector<std::pair<SUMOTime, int> > laneTimeLine;
1034 if (laneIndex < 0 && !veh->getLaneChangeModel().isOpposite()) {
1035 WRITE_WARNING(
"Ignoring indexOffset -1 for vehicle '" + vehicleID +
"' which is already on laneIndex 0");
1037 laneTimeLine.push_back(std::make_pair(
MSNet::getInstance()->getCurrentTimeStep(), laneIndex));
1045 Vehicle::changeSublane(
const std::string& vehicleID,
double latDist) {
1048 if (veh ==
nullptr) {
1049 WRITE_ERROR(
"changeSublane not applicable for meso");
1058 Vehicle::add(
const std::string& vehicleID,
1059 const std::string& routeID,
1060 const std::string& typeID,
1061 const std::string& depart,
1062 const std::string& departLane,
1063 const std::string& departPos,
1064 const std::string& departSpeed,
1065 const std::string& arrivalLane,
1066 const std::string& arrivalPos,
1067 const std::string& arrivalSpeed,
1068 const std::string& fromTaz,
1069 const std::string& toTaz,
1070 const std::string& line,
1074 if (veh !=
nullptr) {
1075 throw TraCIException(
"The vehicle '" + vehicleID +
"' to add already exists.");
1079 vehicleParams.
id = vehicleID;
1082 throw TraCIException(
"Invalid type '" + typeID +
"' for vehicle '" + vehicleID +
"'.");
1086 if (routeID ==
"") {
1092 if (route ==
nullptr) {
1095 std::vector<std::string> edges;
1096 edges.push_back(e->getID());
1097 libsumo::Route::add(dummyRouteID, edges);
1107 throw TraCIException(
"Invalid route '" + routeID +
"' for vehicle '" + vehicleID +
"'.");
1111 if (route->
getEdges().size() == 2) {
1113 if (std::find(succ.begin(), succ.end(), route->
getEdges().back()) == succ.end()) {
1117 if (fromTaz !=
"" || toTaz !=
"") {
1122 throw TraCIException(error);
1126 WRITE_WARNING(
"Departure time for vehicle '" + vehicleID +
"' is in the past; using current time instead.");
1131 throw TraCIException(error);
1134 throw TraCIException(error);
1137 throw TraCIException(error);
1140 throw TraCIException(error);
1143 throw TraCIException(error);
1146 throw TraCIException(error);
1148 vehicleParams.
fromTaz = fromTaz;
1149 vehicleParams.
toTaz = toTaz;
1150 vehicleParams.
line = line;
1157 if (fromTaz ==
"" && !route->
getEdges().front()->validateDepartSpeed(*vehicle)) {
1159 throw TraCIException(
"Departure speed for vehicle '" + vehicleID +
"' is too high for the departure edge '" + route->
getEdges().front()->getID() +
"'.");
1164 throw TraCIException(
"Vehicle '" + vehicleID +
"' has no valid route. ");
1171 throw TraCIException(e.what());
1177 Vehicle::moveToXY(
const std::string& vehicleID,
const std::string& edgeID,
const int laneIndex,
1178 const double x,
const double y,
double angle,
const int keepRoute) {
1181 if (veh ==
nullptr) {
1185 const bool doKeepRoute = (keepRoute & 1) != 0 && veh->
getID() !=
"VTD_EGO";
1186 const bool mayLeaveNetwork = (keepRoute & 2) != 0;
1187 const bool ignorePermissions = (keepRoute & 4) != 0;
1191 const std::string origID = edgeID +
"_" +
toString(laneIndex);
1195 const double origAngle = angle;
1200 while (angle >= 360.) {
1203 while (angle < 0.) {
1211 std::cout <<
" wantedPos=" << pos <<
" origID=" << origID <<
" laneIndex=" << laneIndex <<
" origAngle=" << origAngle <<
" angle=" << angle <<
" keepRoute=" << keepRoute << std::endl;
1217 double lanePosLat = 0;
1218 double bestDistance = std::numeric_limits<double>::max();
1219 int routeOffset = 0;
1221 double maxRouteDistance = 100;
1230 vClass, setLateralPos,
1231 bestDistance, &lane, lanePos, routeOffset);
1237 vClass, setLateralPos,
1238 bestDistance, &lane, lanePos, routeOffset, edges);
1240 if ((found && bestDistance <= maxRouteDistance) || mayLeaveNetwork) {
1243 if (found && setLateralPos) {
1246 lanePosLat = perpDist;
1247 if (!mayLeaveNetwork) {
1255 WRITE_WARNING(
"Could not determine position on lane '" + lane->
getID() +
"' at lateral position " +
toString(-lanePosLat) +
".");
1259 lanePosLat = -lanePosLat;
1268 assert((found && lane != 0) || (!found && lane == 0));
1269 assert(!
ISNAN(lanePos));
1271 if (lane !=
nullptr) {
1280 std::cout <<
SIMTIME <<
" veh=" << vehicleID +
" moveToXYResult lane='" <<
Named::getIDSecure(lane) <<
"' lanePos=" << lanePos <<
" lanePosLat=" << lanePosLat <<
"\n";
1287 if (lane ==
nullptr) {
1288 throw TraCIException(
"Could not map vehicle '" + vehicleID +
"', no road found within " +
toString(maxRouteDistance) +
"m.");
1290 throw TraCIException(
"Could not map vehicle '" + vehicleID +
"', distance to road is " +
toString(bestDistance) +
".");
1296 Vehicle::slowDown(
const std::string& vehicleID,
double speed,
double duration) {
1299 if (veh ==
nullptr) {
1304 std::vector<std::pair<SUMOTime, double> > speedTimeLine;
1311 Vehicle::openGap(
const std::string& vehicleID,
double newTimeHeadway,
double newSpaceHeadway,
double duration,
double changeRate,
double maxDecel,
const std::string& referenceVehID) {
1314 if (veh ==
nullptr) {
1320 if (referenceVehID !=
"") {
1324 if (newTimeHeadway == -1) {
1325 newTimeHeadway = originalTau;
1327 if (originalTau > newTimeHeadway) {
1328 WRITE_WARNING(
"Ignoring openGap(). New time headway must not be smaller than the original.");
1335 Vehicle::deactivateGapControl(
const std::string& vehicleID) {
1338 if (veh ==
nullptr) {
1339 WRITE_ERROR(
"deactivateGapControl not applicable for meso");
1349 Vehicle::requestToC(
const std::string& vehID,
double leadTime) {
1350 setParameter(vehID,
"device.toc.requestToC",
toString(leadTime));
1354 Vehicle::setSpeed(
const std::string& vehicleID,
double speed) {
1357 if (veh ==
nullptr) {
1362 std::vector<std::pair<SUMOTime, double> > speedTimeLine;
1364 speedTimeLine.push_back(std::make_pair(
MSNet::getInstance()->getCurrentTimeStep(), speed));
1371 Vehicle::setPreviousSpeed(
const std::string& vehicleID,
double prevspeed) {
1374 if (veh ==
nullptr) {
1375 WRITE_WARNING(
"setPreviousSpeed not yet implemented for meso");
1383 Vehicle::setSpeedMode(
const std::string& vehicleID,
int speedMode) {
1386 if (veh ==
nullptr) {
1395 Vehicle::setLaneChangeMode(
const std::string& vehicleID,
int laneChangeMode) {
1398 if (veh ==
nullptr) {
1399 WRITE_ERROR(
"setLaneChangeMode not applicable for meso");
1407 Vehicle::setRoutingMode(
const std::string& vehicleID,
int routingMode) {
1412 Vehicle::setType(
const std::string& vehicleID,
const std::string& typeID) {
1414 if (vehicleType ==
nullptr) {
1415 throw TraCIException(
"Vehicle type '" + typeID +
"' is not known");
1421 Vehicle::setRouteID(
const std::string& vehicleID,
const std::string& routeID) {
1425 throw TraCIException(
"The route '" + routeID +
"' is not known.");
1429 WRITE_WARNING(
"Invalid route replacement for vehicle '" + veh->
getID() +
"'. " + msg);
1431 throw TraCIException(
"Route replacement failed for " + veh->
getID());
1436 throw TraCIException(
"Route replacement failed for " + veh->
getID());
1441 Vehicle::setRoute(
const std::string& vehicleID,
const std::string& edgeID) {
1442 setRoute(vehicleID, std::vector<std::string>({edgeID}));
1446 Vehicle::setRoute(
const std::string& vehicleID,
const std::vector<std::string>& edgeIDs) {
1451 if (edges.size() > 0 && edges.back()->isInternal()) {
1452 edges.push_back(edges.back()->getLanes()[0]->getNextNormal());
1455 throw TraCIException(
"Invalid edge list for vehicle '" + veh->
getID() +
"' (" + e.what() +
")");
1458 throw TraCIException(
"Route replacement failed for " + veh->
getID());
1463 Vehicle::updateBestLanes(
const std::string& vehicleID) {
1466 if (veh ==
nullptr) {
1467 WRITE_ERROR(
"updateBestLanes not applicable for meso");
1476 Vehicle::setAdaptedTraveltime(
const std::string& vehicleID,
const std::string& edgeID,
1477 double time,
double begSeconds,
double endSeconds) {
1480 if (edge ==
nullptr) {
1481 throw TraCIException(
"Edge '" + edgeID +
"' is not known.");
1485 if (begSeconds == 0 && endSeconds == std::numeric_limits<double>::max()) {
1502 Vehicle::setEffort(
const std::string& vehicleID,
const std::string& edgeID,
1503 double effort,
double begSeconds,
double endSeconds) {
1506 if (edge ==
nullptr) {
1507 throw TraCIException(
"Edge '" + edgeID +
"' is not known.");
1511 if (begSeconds == 0 && endSeconds == std::numeric_limits<double>::max()) {
1528 Vehicle::rerouteTraveltime(
const std::string& vehicleID,
const bool currentTravelTimes) {
1537 Vehicle::rerouteEffort(
const std::string& vehicleID) {
1545 Vehicle::setSignals(
const std::string& vehicleID,
int signals) {
1548 if (veh ==
nullptr) {
1549 WRITE_ERROR(
"setSignals not applicable for meso");
1564 Vehicle::moveTo(
const std::string& vehicleID,
const std::string& laneID,
double position,
int reason) {
1567 if (veh ==
nullptr) {
1574 throw TraCIException(
"Unknown lane '" + laneID +
"'.");
1589 throw TraCIException(
"Lane '" + laneID +
"' is not on the route of vehicle '" + vehicleID +
"'.");
1593 if (veh->
getLane() !=
nullptr) {
1598 const int newRouteIndex = (int)(it - veh->
getRoute().
begin());
1618 throw TraCIException(
"Invalid moveTo reason '" +
toString(reason) +
"' for vehicle '" + vehicleID +
"'.");
1629 Vehicle::setActionStepLength(
const std::string& vehicleID,
double actionStepLength,
bool resetActionOffset) {
1630 if (actionStepLength < 0.0) {
1631 WRITE_ERROR(
"Invalid action step length (<0). Ignoring command setActionStepLength().");
1636 if (veh ==
nullptr) {
1637 WRITE_ERROR(
"setActionStepLength not applicable for meso");
1641 if (actionStepLength == 0.) {
1650 Vehicle::remove(
const std::string& vehicleID,
char reason) {
1674 throw TraCIException(
"Unknown removal status.");
1679 if (microVeh !=
nullptr) {
1680 if (veh->
getLane() !=
nullptr) {
1693 Vehicle::setColor(
const std::string& vehicleID,
const TraCIColor& col) {
1695 p.
color.
set((
unsigned char)col.r, (
unsigned char)col.g, (
unsigned char)col.b, (
unsigned char)col.a);
1701 Vehicle::setSpeedFactor(
const std::string& vehicleID,
double factor) {
1707 Vehicle::setLine(
const std::string& vehicleID,
const std::string& line) {
1713 Vehicle::setVia(
const std::string& vehicleID,
const std::vector<std::string>& via) {
1720 throw TraCIException(e.what());
1727 Vehicle::setLength(
const std::string& vehicleID,
double length) {
1733 Vehicle::setMaxSpeed(
const std::string& vehicleID,
double speed) {
1739 Vehicle::setVehicleClass(
const std::string& vehicleID,
const std::string& clazz) {
1745 Vehicle::setShapeClass(
const std::string& vehicleID,
const std::string& clazz) {
1751 Vehicle::setEmissionClass(
const std::string& vehicleID,
const std::string& clazz) {
1757 Vehicle::setWidth(
const std::string& vehicleID,
double width) {
1763 Vehicle::setHeight(
const std::string& vehicleID,
double height) {
1769 Vehicle::setMinGap(
const std::string& vehicleID,
double minGap) {
1775 Vehicle::setAccel(
const std::string& vehicleID,
double accel) {
1781 Vehicle::setDecel(
const std::string& vehicleID,
double decel) {
1782 VehicleType::setDecel(
Helper::getVehicle(vehicleID)->getSingularType().getID(), decel);
1787 Vehicle::setEmergencyDecel(
const std::string& vehicleID,
double decel) {
1788 VehicleType::setEmergencyDecel(
Helper::getVehicle(vehicleID)->getSingularType().getID(), decel);
1793 Vehicle::setApparentDecel(
const std::string& vehicleID,
double decel) {
1799 Vehicle::setImperfection(
const std::string& vehicleID,
double imperfection) {
1805 Vehicle::setTau(
const std::string& vehicleID,
double tau) {
1811 Vehicle::setMinGapLat(
const std::string& vehicleID,
double minGapLat) {
1817 Vehicle::setMaxSpeedLat(
const std::string& vehicleID,
double speed) {
1823 Vehicle::setLateralAlignment(
const std::string& vehicleID,
const std::string& latAlignment) {
1829 Vehicle::setParameter(
const std::string& vehicleID,
const std::string& key,
const std::string& value) {
1834 if (tok.size() < 3) {
1835 throw TraCIException(
"Invalid device parameter '" + key +
"' for vehicle '" + vehicleID +
"'");
1838 veh->
setDeviceParameter(tok.get(1), key.substr(tok.get(0).size() + tok.get(1).size() + 2), value);
1840 throw TraCIException(
"Vehicle '" + vehicleID +
"' does not support device parameter '" + key +
"' (" + e.what() +
").");
1843 if (microVeh ==
nullptr) {
1844 throw TraCIException(
"Meso Vehicle '" + vehicleID +
"' does not support laneChangeModel parameters.");
1846 const std::string attrName = key.substr(16);
1850 throw TraCIException(
"Vehicle '" + vehicleID +
"' does not support laneChangeModel parameter '" + key +
"' (" + e.what() +
").");
1853 if (microVeh ==
nullptr) {
1854 throw TraCIException(
"Meso Vehicle '" + vehicleID +
"' does not support carFollowModel parameters.");
1856 const std::string attrName = key.substr(15);
1860 throw TraCIException(
"Vehicle '" + vehicleID +
"' does not support carFollowModel parameter '" + key +
"' (" + e.what() +
").");
1864 if (tok.size() != 3) {
1865 throw TraCIException(
"Invalid request for device status change. Expected format is 'has.DEVICENAME.device'");
1867 const std::string deviceName = tok.get(1);
1872 throw TraCIException(
"Changing device status requires a 'true' or 'false'");
1875 throw TraCIException(
"Device removal is not supported for device of type '" + deviceName +
"'");
1880 throw TraCIException(
"Cannot create vehicle device (" + std::string(e.what()) +
").");
1889 Vehicle::highlight(
const std::string& vehicleID,
const TraCIColor& col,
double size,
const int alphaMax,
const double duration,
const int type) {
1895 const double l2 = veh->
getLength() * 0.5;
1902 const unsigned int nPoints = 34;
1906 #ifdef DEBUG_DYNAMIC_SHAPES
1907 std::cout <<
SIMTIME <<
" Vehicle::highlight() for vehicle '" << vehicleID <<
"'\n"
1908 <<
" circle: " << circlePV << std::endl;
1923 lyr += (type + 1) / 257.;
1929 double maxAttack = 1.0;
1930 std::vector<double> timeSpan;
1931 if (duration > 0.) {
1932 timeSpan = {0,
MIN2(maxAttack, duration / 3.), 2.*duration / 3., duration};
1935 std::vector<double> alphaSpan;
1936 if (alphaMax > 0.) {
1937 alphaSpan = {0., (double) alphaMax, (
double)(alphaMax) / 3., 0.};
1944 Vehicle::dispatchTaxi(
const std::string& vehicleID,
const std::vector<std::string>& reservations) {
1947 if (taxi ==
nullptr) {
1948 throw TraCIException(
"Vehicle '" + vehicleID +
"' is not a taxi");
1951 if (dispatcher ==
nullptr) {
1952 throw TraCIException(
"Cannot dispatch taxi because no reservations have been made");
1955 if (traciDispatcher ==
nullptr) {
1956 throw TraCIException(
"device.taxi.dispatch-algorithm 'traci' has not been loaded");
1958 if (reservations.size() == 0) {
1959 throw TraCIException(
"No reservations have been specified for vehicle '" + vehicleID +
"'");
1964 throw TraCIException(
"Could not interpret reserations for vehicle '" + vehicleID +
"' (" + e.what() +
").");
1972 Vehicle::subscribeLeader(
const std::string& vehicleID,
double dist,
double beginTime,
double endTime) {
1973 Vehicle::subscribe(vehicleID, std::vector<int>({
libsumo::VAR_LEADER}), beginTime, endTime);
1979 Vehicle::addSubscriptionFilterLanes(
const std::vector<int>& lanes,
bool noOpposite,
double downstreamDist,
double upstreamDist) {
1982 s->filterLanes = lanes;
1985 addSubscriptionFilterNoOpposite();
1988 addSubscriptionFilterDownstreamDistance(downstreamDist);
1991 addSubscriptionFilterUpstreamDistance(upstreamDist);
1997 Vehicle::addSubscriptionFilterNoOpposite() {
2003 Vehicle::addSubscriptionFilterDownstreamDistance(
double dist) {
2006 s->filterDownstreamDist = dist;
2012 Vehicle::addSubscriptionFilterUpstreamDistance(
double dist) {
2015 s->filterUpstreamDist = dist;
2021 Vehicle::addSubscriptionFilterCFManeuver(
double downstreamDist,
double upstreamDist) {
2022 addSubscriptionFilterLeadFollow(std::vector<int>({0}));
2024 addSubscriptionFilterDownstreamDistance(downstreamDist);
2027 addSubscriptionFilterUpstreamDistance(upstreamDist);
2034 Vehicle::addSubscriptionFilterLCManeuver(
int direction,
bool noOpposite,
double downstreamDist,
double upstreamDist) {
2035 std::vector<int> lanes;
2038 lanes = std::vector<int>({-1, 0, 1});
2039 }
else if (direction != -1 && direction != 1) {
2040 WRITE_WARNING(
"Ignoring lane change subscription filter with non-neighboring lane offset direction=" +
2043 lanes = std::vector<int>({0, direction});
2045 addSubscriptionFilterLeadFollow(lanes);
2047 addSubscriptionFilterNoOpposite();
2050 addSubscriptionFilterDownstreamDistance(downstreamDist);
2053 addSubscriptionFilterUpstreamDistance(upstreamDist);
2059 Vehicle::addSubscriptionFilterLeadFollow(
const std::vector<int>& lanes) {
2061 addSubscriptionFilterLanes(lanes);
2066 Vehicle::addSubscriptionFilterTurn(
double downstreamDist,
double upstreamDist) {
2069 addSubscriptionFilterDownstreamDistance(downstreamDist);
2072 addSubscriptionFilterUpstreamDistance(upstreamDist);
2078 Vehicle::addSubscriptionFilterVClass(
const std::vector<std::string>& vClasses) {
2087 Vehicle::addSubscriptionFilterVType(
const std::vector<std::string>& vTypes) {
2090 s->filterVTypes.insert(vTypes.begin(), vTypes.end());
2096 Vehicle::addSubscriptionFilterFieldOfVision(
double openingAngle) {
2099 s->filterFieldOfVisionOpeningAngle = openingAngle;
2105 Vehicle::addSubscriptionFilterLateralDistance(
double lateralDist,
double downstreamDist,
double upstreamDist) {
2108 s->filterLateralDist = lateralDist;
2111 addSubscriptionFilterDownstreamDistance(downstreamDist);
2114 addSubscriptionFilterUpstreamDistance(upstreamDist);
2125 std::shared_ptr<VariableWrapper>
2126 Vehicle::makeWrapper() {
2127 return std::make_shared<Helper::SubscriptionWrapper>(handleVariable, mySubscriptionResults, myContextSubscriptionResults);
2132 Vehicle::handleVariable(
const std::string& objID,
const int variable, VariableWrapper* wrapper) {
2135 return wrapper->wrapStringList(objID, variable, getIDList());
2137 return wrapper->wrapInt(objID, variable, getIDCount());
2139 return wrapper->wrapPosition(objID, variable, getPosition(objID));
2141 return wrapper->wrapPosition(objID, variable, getPosition(objID,
true));
2143 return wrapper->wrapDouble(objID, variable, getAngle(objID));
2145 return wrapper->wrapDouble(objID, variable, getSpeed(objID));
2147 return wrapper->wrapDouble(objID, variable, getLateralSpeed(objID));
2149 return wrapper->wrapString(objID, variable, getRoadID(objID));
2151 return wrapper->wrapDouble(objID, variable, getSpeedWithoutTraCI(objID));
2153 return wrapper->wrapDouble(objID, variable, getSlope(objID));
2155 return wrapper->wrapString(objID, variable, getLaneID(objID));
2157 return wrapper->wrapInt(objID, variable, getLaneIndex(objID));
2159 return wrapper->wrapString(objID, variable, getTypeID(objID));
2161 return wrapper->wrapString(objID, variable, getRouteID(objID));
2163 return wrapper->wrapInt(objID, variable, getRouteIndex(objID));
2165 return wrapper->wrapColor(objID, variable, getColor(objID));
2167 return wrapper->wrapDouble(objID, variable, getLanePosition(objID));
2169 return wrapper->wrapDouble(objID, variable, getLateralLanePosition(objID));
2171 return wrapper->wrapDouble(objID, variable, getCO2Emission(objID));
2173 return wrapper->wrapDouble(objID, variable, getCOEmission(objID));
2175 return wrapper->wrapDouble(objID, variable, getHCEmission(objID));
2177 return wrapper->wrapDouble(objID, variable, getPMxEmission(objID));
2179 return wrapper->wrapDouble(objID, variable, getNOxEmission(objID));
2181 return wrapper->wrapDouble(objID, variable, getFuelConsumption(objID));
2183 return wrapper->wrapDouble(objID, variable, getNoiseEmission(objID));
2185 return wrapper->wrapDouble(objID, variable, getElectricityConsumption(objID));
2187 return wrapper->wrapInt(objID, variable, getPersonNumber(objID));
2189 return wrapper->wrapInt(objID, variable, getPersonCapacity(objID));
2191 return wrapper->wrapStringList(objID, variable, getPersonIDList(objID));
2193 return wrapper->wrapDouble(objID, variable, getWaitingTime(objID));
2195 return wrapper->wrapDouble(objID, variable, getAccumulatedWaitingTime(objID));
2197 return wrapper->wrapInt(objID, variable, isRouteValid(objID));
2199 return wrapper->wrapStringList(objID, variable, getRoute(objID));
2201 return wrapper->wrapInt(objID, variable, getSignals(objID));
2203 return wrapper->wrapInt(objID, variable, getStopState(objID));
2205 return wrapper->wrapDouble(objID, variable, getDistance(objID));
2207 return wrapper->wrapDouble(objID, variable, getAllowedSpeed(objID));
2209 return wrapper->wrapDouble(objID, variable, getSpeedFactor(objID));
2211 return wrapper->wrapInt(objID, variable, getSpeedMode(objID));
2213 return wrapper->wrapInt(objID, variable, getLaneChangeMode(objID));
2215 return wrapper->wrapInt(objID, variable, getRoutingMode(objID));
2217 return wrapper->wrapString(objID, variable, getLine(objID));
2219 return wrapper->wrapStringList(objID, variable, getVia(objID));
2221 return wrapper->wrapDouble(objID, variable, getAcceleration(objID));
2223 return wrapper->wrapDouble(objID, variable, getLastActionTime(objID));
2225 return wrapper->wrapDouble(objID, variable, getStopDelay(objID));
2227 return wrapper->wrapDouble(objID, variable, getStopArrivalDelay(objID));
2231 if (wrapper->getParams() !=
nullptr) {
2232 const std::vector<unsigned char>& param = *wrapper->getParams();
2233 memcpy(&dist, param.data(),
sizeof(dist));
2235 const auto& lead = getLeader(objID, dist);
2236 TraCIRoadPosition rp;
2237 rp.edgeID = lead.first;
2238 rp.pos = lead.second;
2239 return wrapper->wrapRoadPosition(objID, variable, rp);
2244 if (wrapper->getParams() !=
nullptr) {
2245 const std::vector<unsigned char>& param = *wrapper->getParams();
2246 memcpy(&dist, param.data(),
sizeof(dist));
2248 const auto& follower = getFollower(objID, dist);
2249 TraCIRoadPosition rp;
2250 rp.edgeID = follower.first;
2251 rp.pos = follower.second;
2252 return wrapper->wrapRoadPosition(objID, variable, rp);
2257 return VehicleType::handleVariableWithID(objID, getTypeID(objID), variable, wrapper);
2262 Vehicle::buildStopParameters(
const std::string& edgeOrStoppingPlaceID,
2263 double pos,
int laneIndex,
double startPos,
int flags,
double duration,
double until) {
2271 if (newStop.
until >= 0) {
2274 if ((flags & 1) != 0) {
2278 if ((flags & 2) != 0) {
2282 if ((flags & 4) != 0) {
2288 if ((flags & 8) != 0) {
2291 if ((flags & 16) != 0) {
2294 if ((flags & 32) != 0) {
2297 if ((flags & 64) != 0) {
2300 if ((flags & 128) != 0) {
2306 if (bs ==
nullptr) {
2307 throw TraCIException(
"The " +
toString(stoppingPlaceType) +
" '" + edgeOrStoppingPlaceID +
"' is not known");
2312 switch (stoppingPlaceType) {
2314 newStop.
busstop = edgeOrStoppingPlaceID;
2329 throw TraCIException(
"Unknown stopping place type '" +
toString(stoppingPlaceType) +
"'.");
2333 startPos = pos - POSITION_EPS;
2335 if (startPos < 0.) {
2336 throw TraCIException(
"Position on lane must not be negative.");
2338 if (pos < startPos) {
2339 throw TraCIException(
"End position on lane must be after start position.");
2343 if (road ==
nullptr) {
2344 throw TraCIException(
"Edge '" + edgeOrStoppingPlaceID +
"' is not known.");
2346 const std::vector<MSLane*>& allLanes = road->
getLanes();
2347 if ((laneIndex < 0) || laneIndex >= (
int)(allLanes.size())) {
2348 throw TraCIException(
"No lane with index '" +
toString(laneIndex) +
"' on edge '" + edgeOrStoppingPlaceID +
"'.");
2350 newStop.
lane = allLanes[laneIndex]->getID();
2360 std::string stoppingPlaceID =
"";
2362 stoppingPlaceID = stopPar.
busstop;
2380 (stopPar.
busstop !=
"" ? 8 : 0) +
2386 return TraCINextStopData(stopPar.
lane,
std::vector< const MSEdge * > ConstMSEdgeVector
std::vector< MSEdge * > MSEdgeVector
ConstMSEdgeVector::const_iterator MSRouteIterator
#define WRITE_WARNING(msg)
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
const int STOP_DURATION_SET
const int VEHPARS_COLOR_SET
const int STOP_PARKING_SET
const int STOP_CONTAINER_TRIGGER_SET
const int VEHPARS_FORCE_REROUTE
const int STOP_TRIGGER_SET
@ DEPART_GIVEN
The time is given.
@ DEPART_CONTAINER_TRIGGERED
The departure is container triggered.
@ DEPART_TRIGGERED
The departure is person triggered.
@ DEPART_NOW
The vehicle is discarded if emission fails (not fully implemented yet)
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_NOTHING
invalid tag
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_OVERHEAD_WIRE_SEGMENT
An overhead wire segment.
@ LCA_UNKNOWN
The action has not been determined.
@ LCA_BLOCKED_BY_RIGHT_LEADER
The vehicle is blocked by right leader.
@ LCA_BLOCKED_BY_LEFT_FOLLOWER
The vehicle is blocked by left follower.
@ LCA_BLOCKED_BY_RIGHT_FOLLOWER
The vehicle is blocked by right follower.
@ LCA_BLOCKED_BY_LEFT_LEADER
const double INVALID_DOUBLE
#define UNUSED_PARAMETER(x)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS)
std::vector< double > & getParameter()
Returns the parameters of this distribution.
static PositionVector makeRing(const double radius1, const double radius2, const Position ¢er, unsigned int nPoints)
static const double INVALID_OFFSET
a value to signify offsets outside the range of [0, Line.length()]
static double naviDegree(const double angle)
A vehicle from the mesoscopic point of view.
SUMOTime getEventTime() const
Returns the (planned) time at which the vehicle leaves his current cell.
const std::shared_ptr< MSLeaderDistanceInfo > getLeaders(const int dir)
Returns the neighboring, lc-relevant leaders for the last step in the requested direction.
virtual void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this laneChangeModel. Throw exception for unsupported key
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, SUMOVehicleClass svc) const
void setRoutingMode(int value)
Sets routing behavior.
int getRoutingMode() const
return the current routing mode
The base class for microscopic and mesoscopic vehicles.
double getMaxSpeed() const
Returns the maximum speed.
MSVehicleDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
void resetRoutePosition(int index, DepartLaneDefinition departLaneProcedure)
reset index of edge within route
virtual BaseInfluencer & getBaseInfluencer()=0
Returns the velocity/lane influencer.
void setChosenSpeedFactor(const double factor)
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
virtual double getStopDelay() const
Returns the estimated public transport stop (departure) delay in seconds.
const std::list< MSStop > & getStops() const
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
bool replaceRouteEdges(ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true)
Replaces the current route by the given edges.
double getFuelConsumption() const
Returns fuel consumption of the current state.
double getCO2Emissions() const
Returns CO2 emission of the current state.
virtual std::pair< const MSVehicle *const, double > getFollower(double dist=0) const
Returns the follower of the vehicle looking for a fixed distance.
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
virtual bool replaceRoute(const MSRoute *route, const std::string &info, bool onInit=false, int offset=0, bool addStops=true, bool removeStops=true)
Replaces the current route by the given one.
double getElectricityConsumption() const
Returns electricity consumption of the current state.
double getOdometer() const
Returns the distance that was already driven by this vehicle.
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
virtual void onRemovalFromNet(const MSMoveReminder::Notification)
Called when the vehicle is removed from the network.
double getLength() const
Returns the vehicle's length.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
double getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
bool hasValidRoute(std::string &msg, const MSRoute *route=0) const
Validates the current or given route.
int getPersonNumber() const
Returns the number of persons.
virtual std::pair< const MSVehicle *const, double > getLeader(double dist=0) const
Returns the leader of the vehicle looking for a fixed distance.
double getNOxEmissions() const
Returns NOx emission of the current state.
double getPMxEmissions() const
Returns PMx emission of the current state.
bool hasDeparted() const
Returns whether this vehicle has already departed.
double getCOEmissions() const
Returns CO emission of the current state.
virtual const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
const MSRouteIterator & getCurrentRouteEdge() const
Returns an iterator pointing to the current edge in this vehicles route.
void setDeviceParameter(const std::string &deviceName, const std::string &key, const std::string &value)
try to set the given parameter from any of the vehicles devices, raise InvalidArgument if no device p...
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
std::string getPrefixedParameter(const std::string &key, std::string &error) const
retrieve parameters of devices, models and the vehicle itself
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
virtual double getStopArrivalDelay() const
Returns the estimated public transport stop arrival delay in seconds.
std::vector< std::string > getPersonIDList() const
Returns the list of persons.
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle's internal edge travel times/efforts container.
double getHCEmissions() const
Returns HC emission of the current state.
int getRoutePosition() const
return index of edge within route
virtual bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
void reroute(SUMOTime t, const std::string &info, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false, const bool silent=false)
Performs a rerouting using the given router.
const std::vector< SUMOVehicleParameter::Stop > & getPastStops() const
const MSRoute & getRoute() const
Returns the current route.
void createDevice(const std::string &deviceName)
create device of the given type
bool isStopped() const
Returns whether the vehicle is at a stop.
virtual double getSecureGap(const MSVehicle *const, const MSVehicle *const, const double speed, const double leaderSpeed, const double leaderMaxDecel) const
Returns the minimum gap to reserve if the leader is braking at maximum (>=0)
double getEmergencyDecel() const
Get the vehicle type's maximal phisically possible deceleration [m/s^2].
virtual double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0) const =0
Computes the vehicle's follow speed (no dawdling)
double getApparentDecel() const
Get the vehicle type's apparent deceleration [m/s^2] (the one regarded by its followers.
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
virtual double getImperfection() const
Get the driver's imperfection.
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
virtual void setParameter(MSVehicle *veh, const std::string &key, const std::string &value) const
try to set the given parameter for this carFollowingModel
virtual double stopSpeed(const MSVehicle *const veh, const double speed, double gap) const =0
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling)
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
A device which collects info on the vehicle trip (mainly on departure and arrival)
static const std::vector< MSDevice_Taxi * > & getFleet()
static MSDispatch * getDispatchAlgorithm()
A dispatch algorithm that services customers in reservation order and always sends the closest availa...
void interpretDispatch(MSDevice_Taxi *taxi, const std::vector< std::string > &reservationsIDs)
trigger taxi dispatch.
An algorithm that performs distpach for a taxi fleet.
A road/street connecting two junctions.
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
static void parseEdgesList(const std::string &desc, ConstMSEdgeVector &into, const std::string &rid)
Parses the given string assuming it contains a list of edge ids divided by spaces.
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_IGNORING) const
Get the allowed lanes to reach the destination-edge.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
bool isInternal() const
return whether this edge is an internal edge
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
const MSEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
bool retrieveExistingTravelTime(const MSEdge *const e, const double t, double &value) const
Returns a travel time for an edge and time if stored.
bool knowsTravelTime(const MSEdge *const e) const
Returns the information whether any travel time is known for the given edge.
void addTravelTime(const MSEdge *const e, double begin, double end, double value)
Adds a travel time information for an edge and a time span.
void removeEffort(const MSEdge *const e)
Removes the effort information for an edge.
bool knowsEffort(const MSEdge *const e) const
Returns the information whether any effort is known for the given edge.
void addEffort(const MSEdge *const e, double begin, double end, double value)
Adds an effort information for an edge and a time span.
bool retrieveExistingEffort(const MSEdge *const e, const double t, double &value) const
Returns an effort for an edge and time if stored.
void removeTravelTime(const MSEdge *const e)
Removes the travel time information for an edge.
static double gLateralResolution
void alreadyDeparted(SUMOVehicle *veh)
stops trying to emit the given vehicle (because it already departed)
void add(SUMOVehicle *veh)
Adds a single vehicle for departure.
Representation of a lane in the micro simulation.
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
static std::vector< MSLink * >::const_iterator succLinkSec(const SUMOVehicle &veh, int nRouteSuccs, const MSLane &succLinkSource, const std::vector< MSLane * > &conts)
void forceVehicleInsertion(MSVehicle *veh, double pos, MSMoveReminder::Notification notification, double posLat=0)
Inserts the given vehicle at the given position.
const MSEdge * getNextNormal() const
Returns the lane's follower if it is an internal lane, the edge of the lane otherwise.
double getLength() const
Returns the lane's length.
bool isLinkEnd(std::vector< MSLink * >::const_iterator &i) const
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
MSEdge & getEdge() const
Returns the lane's edge.
const PositionVector & getShape() const
Returns this lane's shape.
double getWidth() const
Returns the lane's width.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
Notification
Definition of a vehicle state.
@ NOTIFICATION_VAPORIZED_TRACI
The vehicle got removed via TraCI.
@ NOTIFICATION_ARRIVED
The vehicle arrived at its destination (is deleted)
@ NOTIFICATION_TELEPORT_ARRIVED
The vehicle was teleported out of the net.
@ NOTIFICATION_DEPARTED
The vehicle has departed (was inserted into the network)
@ NOTIFICATION_JUNCTION
The vehicle arrived at a junction.
@ NOTIFICATION_TELEPORT
The vehicle is being teleported.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
static bool dictionary(const std::string &id, const MSRoute *route)
Adds a route to the dictionary.
double getDistanceBetween(double fromPos, double toPos, const MSEdge *fromEdge, const MSEdge *toEdge, bool includeInternal=true, int routePosition=0) const
Compute the distance between 2 given edges on this route, including the length of internal lanes....
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
const ConstMSEdgeVector & getEdges() const
MSStoppingPlace * containerstop
(Optional) container stop if one is assigned to the stop
bool reached
Information whether the stop has been reached.
MSRouteIterator edge
The edge in the route to stop at.
MSParkingArea * parkingarea
(Optional) parkingArea if one is assigned to the stop
MSStoppingPlace * chargingStation
(Optional) charging station if one is assigned to the stop
SUMOTime duration
The stopping duration.
const SUMOVehicleParameter::Stop pars
The stop parameter.
MSStoppingPlace * busstop
(Optional) bus stop if one is assigned to the stop
A lane area vehicles can halt at.
double getBeginLanePosition() const
Returns the begin position of this stop.
double getEndLanePosition() const
Returns the end position of this stop.
const MSLane & getLane() const
Returns the lane this stop is located at.
void setLaneChangeMode(int value)
Sets lane changing behavior.
void deactivateGapController()
Deactivates the gap control.
void setSpeedMode(int speedMode)
Sets speed-constraining behaviors.
void setLaneTimeLine(const std::vector< std::pair< SUMOTime, int > > &laneTimeLine)
Sets a new lane timeline.
void setSublaneChange(double latDist)
Sets a new sublane-change request.
void setSignals(int signals)
void setSpeedTimeLine(const std::vector< std::pair< SUMOTime, double > > &speedTimeLine)
Sets a new velocity timeline.
void activateGapController(double originalTau, double newTimeHeadway, double newSpaceHeadway, double duration, double changeRate, double maxDecel, MSVehicle *refVeh=nullptr)
Activates the gap control with the given parameters,.
The class responsible for building and deletion of vehicles.
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
virtual void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
virtual bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
SUMOVehicle * getVehicle(const std::string &id) const
Returns the vehicle with the given id.
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID, std::mt19937 *rng=nullptr)
Returns the named vehicle type or a sample from the named distribution.
void scheduleVehicleRemoval(SUMOVehicle *veh, bool checkDuplicate=false)
Removes a vehicle after it has ended.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
virtual SUMOVehicle * buildVehicle(SUMOVehicleParameter *defs, const MSRoute *route, MSVehicleType *type, const bool ignoreStopErrors, const bool fromRouteFile=true)
Builds a vehicle, increases the number of built vehicles.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
Representation of a vehicle in the micro simulation.
void updateBestLanes(bool forceRebuild=false, const MSLane *startLane=0)
computes the best lanes to use in order to continue the route
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
SUMOTime getLastActionTime() const
Returns the time of the vehicle's last action point.
void setTentativeLaneAndPosition(MSLane *lane, double pos, double posLat=0)
set tentative lane and position during insertion to ensure that all cfmodels work (some of them requi...
bool replaceStop(int nextStopIndex, SUMOVehicleParameter::Stop stop, const std::string &info, std::string &errorMsg)
void setPreviousSpeed(double prevspeed)
Sets the influenced previous speed.
MSAbstractLaneChangeModel & getLaneChangeModel()
MSLane * getMutableLane() const
Returns the lane the vehicle is on Non const version indicates that something volatile is going on.
bool addTraciStop(SUMOVehicleParameter::Stop stop, std::string &errorMsg)
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the best sequence of lanes to continue the route starting at myLane.
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
bool resumeFromStopping()
void resetActionOffset(const SUMOTime timeUntilNextAction=0)
Resets the action offset for the vehicle.
bool rerouteParkingArea(const std::string &parkingAreaID, std::string &errorMsg)
void switchOffSignal(int signal)
Switches the given signal off.
@ VEH_SIGNAL_NONE
Everything is switched off.
Influencer & getInfluencer()
void setActionStepLength(double actionStepLength, bool resetActionOffset=true)
Sets the action steplength of the vehicle.
double getSpeed() const
Returns the vehicle's current speed.
const std::vector< LaneQ > & getBestLanes() const
Returns the description of best lanes to use in order to continue the route.
double getPositionOnLane() const
Get the vehicle's position along the lane.
const MSLane * getLane() const
Returns the lane the vehicle is on.
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
bool hasInfluencer() const
void switchOnSignal(int signal)
Switches the given signal on.
The car-following model and parameter.
void setHeight(const double &height)
Set a new value for this type's height.
void setMaxSpeedLat(const double &maxSpeedLat)
Set a new value for this type's maximum lateral speed.
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
void setEmissionClass(SUMOEmissionClass eclass)
Set a new value for this type's emission class.
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
int getPersonCapacity() const
Get this vehicle type's person capacity.
void setMinGapLat(const double &minGapLat)
Set a new value for this type's minimum lataral gap.
double getMinGap() const
Get the free space in front of vehicles of this class.
void setApparentDecel(double apparentDecel)
Set a new value for this type's apparent deceleration.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
void setMaxSpeed(const double &maxSpeed)
Set a new value for this type's maximum speed.
double getActionStepLengthSecs() const
Returns this type's default action step length in seconds.
void setLength(const double &length)
Set a new value for this type's length.
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
void setVClass(SUMOVehicleClass vclass)
Set a new value for this type's vehicle class.
void setAccel(double accel)
Set a new value for this type's acceleration.
void setWidth(const double &width)
Set a new value for this type's width.
void setImperfection(double imperfection)
Set a new value for this type's imperfection.
const Distribution_Parameterized & getSpeedFactor() const
Returns this type's speed factor.
void setTau(double tau)
Set a new value for this type's headway.
void setPreferredLateralAlignment(LateralAlignment latAlignment)
Set vehicle's preferred lateral alignment.
const std::string & getID() const
Returns the name of the vehicle type.
double getLength() const
Get vehicle's length [m].
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
void setMinGap(const double &minGap)
Set a new value for this type's minimum gap.
void setShape(SUMOVehicleShape shape)
Set a new value for this type's shape.
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
const std::string & getID() const
Returns the id.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
A point in 2D or 3D with translation and scaling methods.
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
void sub(double dx, double dy)
Substracts the given position from this one.
void setz(double z)
set position z
double z() const
Returns the z-position.
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
double distance2D(const Position &p, bool perpendicular=false) const
closest 2D-distance to point p (or -1 if perpendicular is true and the point is beyond this vector)
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
void set(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
assigns new values
virtual bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...
virtual double getSlope() const =0
Returns the slope of the road at object's position in degrees.
virtual double getSpeed() const =0
Returns the object's current speed.
virtual Position getPosition(const double offset=0) const =0
Return current position (x/y, cartesian)
virtual const MSLane * getLane() const =0
Returns the lane the object is currently at.
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
Representation of a vehicle.
virtual bool wasRemoteControlled(SUMOTime lookBack=DELTA_T) const =0
Returns the information whether the vehicle is fully controlled via TraCI.
virtual bool isOnRoad() const =0
Returns the information whether the vehicle is on a road (is simulated)
virtual int getRouteValidity(bool update=true, bool silent=false)=0
computes validity attributes for the current route
virtual bool isParking() const =0
Returns the information whether the vehicle is parked.
virtual double getAngle() const =0
Get the vehicle's angle.
Definition of vehicle stop (position and duration)
std::string lane
The lane to stop at.
SUMOTime depart
the time at which this stop was ended
double speed
the speed at which this stop counts as reached (waypoint mode)
std::string parkingarea
(Optional) parking area if one is assigned to the stop
std::string split
the id of the vehicle (train portion) that splits of upon reaching this stop
double startPos
The stopping position start.
std::string line
the new line id of the trip within a cyclical public transport route
std::string chargingStation
(Optional) charging station if one is assigned to the stop
std::string overheadWireSegment
(Optional) overhead line segment if one is assigned to the stop
int parametersSet
Information for the output which parameter were set.
int index
at which position in the stops list
std::string join
the id of the vehicle (train portion) to which this vehicle shall be joined
SUMOTime actualArrival
the time at which this stop was reached
SUMOTime until
The time at which the vehicle may continue its journey.
std::string actType
act Type (only used by Persons) (used by NETEDIT)
bool triggered
whether an arriving person lets the vehicle continue
double endPos
The stopping position end.
bool parking
whether the vehicle is removed from the net while stopping
std::string busstop
(Optional) bus stop if one is assigned to the stop
std::string tripId
id of the trip within a cyclical public transport route
std::string containerstop
(Optional) container stop if one is assigned to the stop
bool containerTriggered
whether an arriving container lets the vehicle continue
SUMOTime arrival
The (expected) time at which the vehicle reaches the stop.
SUMOTime duration
The stopping duration.
Structure representing possible vehicle parameter.
int parametersSet
Information for the router which parameter were set, TraCI may modify this (when changing color)
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
double departSpeed
(optional) The initial speed of the vehicle
std::vector< std::string > via
List of the via-edges the vehicle must visit.
static bool parseArrivalLane(const std::string &val, const std::string &element, const std::string &id, int &lane, ArrivalLaneDefinition &ald, std::string &error)
Validates a given arrivalLane value.
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
static bool parseDepartSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, DepartSpeedDefinition &dsd, std::string &error)
Validates a given departSpeed value.
static bool parseArrivalPos(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosDefinition &apd, std::string &error)
Validates a given arrivalPos value.
int personNumber
The static number of persons in the vehicle when it departs (not including boarding persons)
static bool parseArrivalSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, ArrivalSpeedDefinition &asd, std::string &error)
Validates a given arrivalSpeed value.
double departPos
(optional) The position the vehicle shall depart from
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
RGBColor color
The vehicle's color, TraCI may change this.
double arrivalPos
(optional) The position the vehicle shall arrive on
static bool parseDepartLane(const std::string &val, const std::string &element, const std::string &id, int &lane, DepartLaneDefinition &dld, std::string &error)
Validates a given departLane value.
std::string id
The vehicle's id.
static bool parseDepart(const std::string &val, const std::string &element, const std::string &id, SUMOTime &depart, DepartDefinition &dd, std::string &error)
Validates a given depart value.
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
std::string toTaz
The vehicle's destination zone (district)
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
static bool parseDepartPos(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosDefinition &dpd, std::string &error)
Validates a given departPos value.
std::string fromTaz
The vehicle's origin zone (district)
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
std::string line
The vehicle's line (mainly for public transport)
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
static bool endsWith(const std::string &str, const std::string suffix)
Checks whether a given string ends with the suffix.
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
C++ TraCI client API implementation.
static MSEdge * getEdge(const std::string &edgeID)
static TraCIPosition makeTraCIPosition(const Position &position, const bool includeZ=false)
static bool moveToXYMap_matchingRoutePosition(const Position &pos, const std::string &origID, const ConstMSEdgeVector ¤tRoute, int routeIndex, SUMOVehicleClass vClass, bool setLateralPos, double &bestDistance, MSLane **lane, double &lanePos, int &routeOffset)
static TraCIPositionVector makeTraCIPositionVector(const PositionVector &positionVector)
helper functions
static MSBaseVehicle * getVehicle(const std::string &id)
static TraCIColor makeTraCIColor(const RGBColor &color)
static void setRemoteControlled(MSVehicle *v, Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, ConstMSEdgeVector route, SUMOTime t)
static const MSVehicleType & getVehicleType(const std::string &vehicleID)
static bool moveToXYMap(const Position &pos, double maxRouteDistance, bool mayLeaveNetwork, const std::string &origID, const double angle, double speed, const ConstMSEdgeVector ¤tRoute, const int routePosition, const MSLane *currentLane, double currentLanePos, bool onRoad, SUMOVehicleClass vClass, bool setLateralPos, double &bestDistance, MSLane **lane, double &lanePos, int &routeOffset, ConstMSEdgeVector &edges)
static std::pair< MSLane *, double > convertCartesianToRoadMap(const Position &pos, const SUMOVehicleClass vClass)
static void addSubscriptionParam(double param)
static Subscription * addSubscriptionFilter(SubscriptionFilterType filter)
static void addDynamics(const std::string &polygonID, const std::string &trackedID="", const std::vector< double > &timeSpan=std::vector< double >(), const std::vector< double > &alphaSpan=std::vector< double >(), bool looped=false, bool rotate=true)
static void addHighlightPolygon(const std::string &objectID, const int type, const std::string &polygonID, const TraCIPositionVector &shape, const TraCIColor &color, bool fill, const std::string &polygonType, int layer, double lineWidth)
static bool exists(std::string polyID)
Checks if a polygon of the given name exists already in the simulation.
#define CALL_MICRO_FUN(veh, fun, mesoResult)
TRACI_CONST double INVALID_DOUBLE_VALUE
TRACI_CONST int VAR_LASTACTIONTIME
TRACI_CONST int VAR_EDGES
TRACI_CONST int VAR_NOXEMISSION
TRACI_CONST int VAR_LANECHANGE_MODE
TRACI_CONST int MOVE_AUTOMATIC
TRACI_CONST int LAST_STEP_PERSON_ID_LIST
TRACI_CONST int TRACI_ID_LIST
TRACI_CONST int VAR_ROUTING_MODE
TRACI_CONST int VAR_WAITING_TIME
TRACI_CONST int VAR_ROAD_ID
TRACI_CONST int MOVE_NORMAL
TRACI_CONST int VAR_SPEED_FACTOR
TRACI_CONST int VAR_STOP_ARRIVALDELAY
TRACI_CONST int VAR_SPEED_LAT
TRACI_CONST int VAR_ANGLE
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 MOVE_TELEPORT
TRACI_CONST int VAR_PERSON_NUMBER
TRACI_CONST int VAR_COEMISSION
TRACI_CONST int VAR_COLOR
TRACI_CONST int VAR_POSITION
TRACI_CONST int VAR_PERSON_CAPACITY
TRACI_CONST int VAR_LEADER
TRACI_CONST int VAR_CO2EMISSION
TRACI_CONST int REMOVE_TELEPORT
TRACI_CONST int VAR_TAXI_FLEET
TRACI_CONST int VAR_ROUTE_VALID
TRACI_CONST int VAR_SPEEDSETMODE
TRACI_CONST int VAR_FUELCONSUMPTION
TRACI_CONST int VAR_SLOPE
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
TRACI_CONST int VAR_HCEMISSION
TRACI_CONST int VAR_LANEPOSITION
TRACI_CONST int REMOVE_PARKING
TRACI_CONST int VAR_LANE_ID
TRACI_CONST int VAR_NOISEEMISSION
TRACI_CONST int VAR_POSITION3D
TRACI_CONST int VAR_SPEED
TRACI_CONST int VAR_SIGNALS
TRACI_CONST int VAR_ACCUMULATED_WAITING_TIME
TRACI_CONST int INVALID_INT_VALUE
TRACI_CONST int VAR_ROUTE_INDEX
TRACI_CONST int VAR_ACCELERATION
TRACI_CONST int VAR_ROUTE_ID
TRACI_CONST int REMOVE_ARRIVED
@ SUBS_FILTER_LEAD_FOLLOW
@ SUBS_FILTER_UPSTREAM_DIST
@ SUBS_FILTER_DOWNSTREAM_DIST
@ SUBS_FILTER_LATERAL_DIST
@ SUBS_FILTER_FIELD_OF_VISION
TRACI_CONST int VAR_LANEPOSITION_LAT
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
TRACI_CONST int VAR_STOP_DELAY
TRACI_CONST int REMOVE_TELEPORT_ARRIVED
TRACI_CONST int REMOVE_VAPORIZED
TRACI_CONST int VAR_STOPSTATE
TRACI_CONST int VAR_FOLLOWER
TRACI_CONST int VAR_DISTANCE
TRACI_CONST int VAR_ELECTRICITYCONSUMPTION
A structure representing the best lanes for continuing the current route starting at 'lane'.