61 const std::string
id = inputStorage.
readString();
64 if (!libsumo::Vehicle::handleVariable(
id, variable, &server, &inputStorage)) {
70 if (inputStorage.
readInt() != 2) {
91 if (inputStorage.
readInt() != 2) {
112 std::vector<libsumo::TraCIBestLanesData> bestLanes = libsumo::Vehicle::getBestLanes(
id);
113 tempContent.
writeInt((
int)bestLanes.size());
115 for (std::vector<libsumo::TraCIBestLanesData>::const_iterator i = bestLanes.begin(); i != bestLanes.end(); ++i) {
141 std::vector<libsumo::TraCINextTLSData> nextTLS = libsumo::Vehicle::getNextTLS(
id);
143 const int cnt = 1 + (int)nextTLS.size() * 4;
147 for (std::vector<libsumo::TraCINextTLSData>::iterator it = nextTLS.begin(); it != nextTLS.end(); ++it) {
173 std::vector<libsumo::TraCIConnection> links = libsumo::Vehicle::getNextLinks(
id);
178 tempContent.
writeInt((
int)links.size());
180 for (std::vector<libsumo::TraCIConnection>::const_iterator i = links.begin(); i != links.end(); ++i) {
223 int compoundSize = inputStorage.
readInt();
224 if (compoundSize != 2 && compoundSize != 3) {
236 if (compoundSize == 3) {
249 if (inputStorage.
readInt() != 2) {
258 const std::string roadID = inputStorage.
readString();
259 const double edgePos = inputStorage.
readDouble();
293 const std::pair<int, int> state = libsumo::Vehicle::getLaneChangeState(
id, direction);
316 const std::vector<std::pair<std::string, double> >& neighVehicles = libsumo::Vehicle::getNeighbors(
id, mode);
319 for (
auto& p : neighVehicles) {
329 int parameterCount = inputStorage.
readInt();
333 double leaderMaxDecel;
334 std::string leaderID;
335 if (parameterCount == 5) {
368 int parameterCount = inputStorage.
readInt();
371 double leaderMaxDecel;
372 std::string leaderID;
373 if (parameterCount == 4) {
402 int parameterCount = inputStorage.
readInt();
405 if (parameterCount == 2) {
427 std::vector<libsumo::TraCIJunctionFoe> junctionFoes = libsumo::Vehicle::getJunctionFoes(
id, distance);
429 const int cnt = 1 + (int)junctionFoes.size() * 9;
433 for (std::vector<libsumo::TraCIJunctionFoe>::iterator it = junctionFoes.begin(); it != junctionFoes.end(); ++it) {
471 std::string warning =
"";
515 std::cout <<
SIMTIME <<
" processSet veh=" <<
id <<
"\n";
519 if (sumoVehicle ==
nullptr) {
525 if (v ==
nullptr && shouldExist) {
534 int compoundSize = inputStorage.
readInt();
535 if (compoundSize < 4 || compoundSize > 7) {
557 if (compoundSize >= 5) {
563 if (compoundSize >= 6) {
569 if (compoundSize >= 7) {
574 libsumo::Vehicle::setStop(
id, edgeID, pos, laneIndex, duration, stopFlags, startPos, until);
592 int compoundSize = inputStorage.
readInt();
593 if (compoundSize != 3 && compoundSize != 4) {
609 if (compoundSize == 4) {
614 libsumo::Vehicle::setStopParameter(
id, nextStopIndex, param, value, customParam != 0);
622 int compoundSize = inputStorage.
readInt();
623 if (compoundSize != 1) {
626 std::string parkingAreaID;
630 libsumo::Vehicle::rerouteParkingArea(
id, parkingAreaID);
638 if (inputStorage.
readInt() != 0) {
642 libsumo::Vehicle::resume(
id);
649 int compounds = inputStorage.
readInt();
650 if (compounds != 3 && compounds != 2) {
659 double duration = 0.;
665 if (compounds == 3) {
671 if ((laneIndex < 0 || laneIndex >= (
int)v->
getEdge()->
getLanes().size()) && relative < 1) {
676 libsumo::Vehicle::changeLane(
id, laneIndex, duration);
678 libsumo::Vehicle::changeLaneRelative(
id, laneIndex, duration);
687 libsumo::Vehicle::changeSublane(
id, latDist);
694 if (inputStorage.
readInt() != 2) {
704 double duration = 0.;
711 libsumo::Vehicle::slowDown(
id, newSpeed, duration);
719 libsumo::Vehicle::changeTarget(
id, edgeID);
726 const int nParameter = inputStorage.
readInt();
727 if (nParameter != 5 && nParameter != 6) {
730 double newTimeHeadway = 0;
734 double newSpaceHeadway = 0;
738 double duration = 0.;
742 double changeRate = 0;
751 if (newTimeHeadway == -1 && newSpaceHeadway == -1 && duration == -1 && changeRate == -1 && maxDecel == -1) {
752 libsumo::Vehicle::deactivateGapControl(
id);
754 if (newTimeHeadway <= 0) {
755 if (newTimeHeadway != -1) {
759 if (newSpaceHeadway < 0) {
765 if (changeRate <= 0) {
771 std::string refVehID =
"";
772 if (nParameter == 6) {
777 libsumo::Vehicle::openGap(
id, newTimeHeadway, newSpaceHeadway, duration, changeRate, maxDecel, refVehID);
786 libsumo::Vehicle::setType(
id, vTypeID);
794 libsumo::Vehicle::setRouteID(
id, rid);
798 std::vector<std::string> edgeIDs;
802 libsumo::Vehicle::setRoute(
id, edgeIDs);
809 int parameterCount = inputStorage.
readInt();
812 double endTime = std::numeric_limits<double>::max();
814 if (parameterCount == 4) {
831 }
else if (parameterCount == 2) {
840 }
else if (parameterCount == 1) {
848 libsumo::Vehicle::setAdaptedTraveltime(
id, edgeID, value, begTime, endTime);
855 int parameterCount = inputStorage.
readInt();
858 double endTime = std::numeric_limits<double>::max();
860 if (parameterCount == 4) {
877 }
else if (parameterCount == 2) {
885 }
else if (parameterCount == 1) {
894 libsumo::Vehicle::setEffort(
id, edgeID, value, begTime, endTime);
901 if (inputStorage.
readInt() != 0) {
904 libsumo::Vehicle::rerouteTraveltime(
id,
false);
911 if (inputStorage.
readInt() != 0) {
914 libsumo::Vehicle::rerouteEffort(
id);
922 libsumo::Vehicle::setSignals(
id, signals);
929 const int numArgs = inputStorage.
readInt();
930 if (numArgs < 2 || numArgs > 3) {
950 libsumo::Vehicle::moveTo(
id, laneID, position, reason);
954 double impatience = 0;
958 libsumo::Vehicle::setImpatience(
id, impatience);
966 libsumo::Vehicle::setSpeed(
id, speed);
974 int parameterCount = inputStorage.
readInt();
975 if (parameterCount == 2) {
991 libsumo::Vehicle::setAcceleration(
id, accel, duration);
995 double prevSpeed = 0;
1000 int parameterCount = inputStorage.
readInt();
1001 if (parameterCount == 2) {
1008 }
else if (parameterCount == 1) {
1021 if (prevSpeed < 0) {
1024 libsumo::Vehicle::setPreviousSpeed(
id, prevSpeed, prevAcceleration);
1032 libsumo::Vehicle::setSpeedMode(
id, speedMode);
1036 int laneChangeMode = 0;
1040 libsumo::Vehicle::setLaneChangeMode(
id, laneChangeMode);
1044 int routingMode = 0;
1048 libsumo::Vehicle::setRoutingMode(
id, routingMode);
1056 libsumo::Vehicle::setColor(
id, col);
1063 if (inputStorage.
readInt() != 6) {
1066 std::string vTypeID;
1070 std::string routeID;
1080 depart =
"triggered";
1082 depart =
"containerTriggered";
1091 double departPosCode;
1095 std::string departPos =
toString(departPosCode);
1097 departPos =
"random";
1099 departPos =
"random_free";
1110 double departSpeedCode;
1114 std::string departSpeed =
toString(departSpeedCode);
1116 departSpeed =
"random";
1118 departSpeed =
"max";
1120 departSpeed =
"desired";
1122 departSpeed =
"speedLimit";
1124 departSpeed =
"last";
1126 departSpeed =
"avg";
1133 std::string departLane =
toString(departLaneCode);
1135 departLane =
"random";
1137 departLane =
"free";
1139 departLane =
"allowed";
1141 departLane =
"best";
1143 departLane =
"first";
1145 libsumo::Vehicle::add(
id, routeID, vTypeID, depart, departLane, departPos, departSpeed);
1152 if (inputStorage.
readInt() != 14) {
1155 std::string routeID;
1159 std::string vTypeID;
1167 std::string departLane;
1171 std::string departPos;
1175 std::string departSpeed;
1179 std::string arrivalLane;
1183 std::string arrivalPos;
1187 std::string arrivalSpeed;
1191 std::string fromTaz;
1211 libsumo::Vehicle::add(
id, routeID, vTypeID, depart, departLane, departPos, departSpeed, arrivalLane, arrivalPos, arrivalSpeed,
1212 fromTaz, toTaz, line, personCapacity, personNumber);
1220 libsumo::Vehicle::remove(
id, (
char)why);
1227 const int numArgs = inputStorage.
readInt();
1228 if (numArgs < 5 || numArgs > 7) {
1257 int keepRouteFlag = 1;
1263 double matchThreshold = 100;
1269 libsumo::Vehicle::moveToXY(
id, edgeID, laneNum, x, y, angle, keepRouteFlag, matchThreshold);
1277 libsumo::Vehicle::setSpeedFactor(
id, factor);
1285 libsumo::Vehicle::setLine(
id, line);
1289 std::vector<std::string> edgeIDs;
1293 libsumo::Vehicle::setVia(
id, edgeIDs);
1312 libsumo::Vehicle::setParameter(
id, name, value);
1323 const int itemNo = inputStorage.
readInt();
1345 double duration = -1;
1357 libsumo::Vehicle::highlight(
id, col, size, alphaMax, duration, type);
1361 std::vector<std::string> reservations;
1365 libsumo::Vehicle::dispatchTaxi(
id, reservations);
1373 if (fabs(value) == std::numeric_limits<double>::infinity()) {
1376 bool resetActionOffset = value >= 0.0;
1377 libsumo::Vehicle::setActionStepLength(
id, fabs(value), resetActionOffset);
1385 libsumo::Vehicle::setLateralLanePosition(
id, value);
1389 libsumo::Vehicle::updateBestLanes(
id);
1397 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
1400 libsumo::Vehicle::setMinGap(
id, value);
1408 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
1411 libsumo::Vehicle::setMinGapLat(
id, value);