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 =
"";
514 std::cout <<
SIMTIME <<
" processSet veh=" <<
id <<
"\n";
518 if (sumoVehicle ==
nullptr) {
524 if (v ==
nullptr && shouldExist) {
533 int compoundSize = inputStorage.
readInt();
534 if (compoundSize < 4 || compoundSize > 7) {
556 if (compoundSize >= 5) {
562 if (compoundSize >= 6) {
568 if (compoundSize >= 7) {
573 libsumo::Vehicle::setStop(
id, edgeID, pos, laneIndex, duration, stopFlags, startPos, until);
591 int compoundSize = inputStorage.
readInt();
592 if (compoundSize != 3 && compoundSize != 4) {
608 if (compoundSize == 4) {
613 libsumo::Vehicle::setStopParameter(
id, nextStopIndex, param, value, customParam != 0);
621 int compoundSize = inputStorage.
readInt();
622 if (compoundSize != 1) {
625 std::string parkingAreaID;
629 libsumo::Vehicle::rerouteParkingArea(
id, parkingAreaID);
637 if (inputStorage.
readInt() != 0) {
641 libsumo::Vehicle::resume(
id);
648 int compounds = inputStorage.
readInt();
649 if (compounds != 3 && compounds != 2) {
658 double duration = 0.;
664 if (compounds == 3) {
670 if ((laneIndex < 0 || laneIndex >= (
int)v->
getEdge()->
getLanes().size()) && relative < 1) {
675 libsumo::Vehicle::changeLane(
id, laneIndex, duration);
677 libsumo::Vehicle::changeLaneRelative(
id, laneIndex, duration);
686 libsumo::Vehicle::changeSublane(
id, latDist);
693 if (inputStorage.
readInt() != 2) {
703 double duration = 0.;
710 libsumo::Vehicle::slowDown(
id, newSpeed, duration);
718 libsumo::Vehicle::changeTarget(
id, edgeID);
725 const int nParameter = inputStorage.
readInt();
726 if (nParameter != 5 && nParameter != 6) {
729 double newTimeHeadway = 0;
733 double newSpaceHeadway = 0;
737 double duration = 0.;
741 double changeRate = 0;
750 if (newTimeHeadway == -1 && newSpaceHeadway == -1 && duration == -1 && changeRate == -1 && maxDecel == -1) {
751 libsumo::Vehicle::deactivateGapControl(
id);
753 if (newTimeHeadway <= 0) {
754 if (newTimeHeadway != -1) {
758 if (newSpaceHeadway < 0) {
764 if (changeRate <= 0) {
770 std::string refVehID =
"";
771 if (nParameter == 6) {
776 libsumo::Vehicle::openGap(
id, newTimeHeadway, newSpaceHeadway, duration, changeRate, maxDecel, refVehID);
785 libsumo::Vehicle::setType(
id, vTypeID);
793 libsumo::Vehicle::setRouteID(
id, rid);
797 std::vector<std::string> edgeIDs;
801 libsumo::Vehicle::setRoute(
id, edgeIDs);
808 int parameterCount = inputStorage.
readInt();
811 double endTime = std::numeric_limits<double>::max();
813 if (parameterCount == 4) {
830 }
else if (parameterCount == 2) {
839 }
else if (parameterCount == 1) {
847 libsumo::Vehicle::setAdaptedTraveltime(
id, edgeID, value, begTime, endTime);
854 int parameterCount = inputStorage.
readInt();
857 double endTime = std::numeric_limits<double>::max();
859 if (parameterCount == 4) {
876 }
else if (parameterCount == 2) {
884 }
else if (parameterCount == 1) {
893 libsumo::Vehicle::setEffort(
id, edgeID, value, begTime, endTime);
900 if (inputStorage.
readInt() != 0) {
903 libsumo::Vehicle::rerouteTraveltime(
id,
false);
910 if (inputStorage.
readInt() != 0) {
913 libsumo::Vehicle::rerouteEffort(
id);
921 libsumo::Vehicle::setSignals(
id, signals);
928 const int numArgs = inputStorage.
readInt();
929 if (numArgs < 2 || numArgs > 3) {
949 libsumo::Vehicle::moveTo(
id, laneID, position, reason);
953 double impatience = 0;
957 libsumo::Vehicle::setImpatience(
id, impatience);
965 libsumo::Vehicle::setSpeed(
id, speed);
973 int parameterCount = inputStorage.
readInt();
974 if (parameterCount == 2) {
990 libsumo::Vehicle::setAcceleration(
id, accel, duration);
994 double prevSpeed = 0;
999 int parameterCount = inputStorage.
readInt();
1000 if (parameterCount == 2) {
1007 }
else if (parameterCount == 1) {
1020 if (prevSpeed < 0) {
1023 libsumo::Vehicle::setPreviousSpeed(
id, prevSpeed, prevAcceleration);
1031 libsumo::Vehicle::setSpeedMode(
id, speedMode);
1035 int laneChangeMode = 0;
1039 libsumo::Vehicle::setLaneChangeMode(
id, laneChangeMode);
1043 int routingMode = 0;
1047 libsumo::Vehicle::setRoutingMode(
id, routingMode);
1055 libsumo::Vehicle::setColor(
id, col);
1062 if (inputStorage.
readInt() != 6) {
1065 std::string vTypeID;
1069 std::string routeID;
1079 depart =
"triggered";
1081 depart =
"containerTriggered";
1090 double departPosCode;
1094 std::string departPos =
toString(departPosCode);
1096 departPos =
"random";
1098 departPos =
"random_free";
1109 double departSpeedCode;
1113 std::string departSpeed =
toString(departSpeedCode);
1115 departSpeed =
"random";
1117 departSpeed =
"max";
1119 departSpeed =
"desired";
1121 departSpeed =
"speedLimit";
1123 departSpeed =
"last";
1125 departSpeed =
"avg";
1132 std::string departLane =
toString(departLaneCode);
1134 departLane =
"random";
1136 departLane =
"free";
1138 departLane =
"allowed";
1140 departLane =
"best";
1142 departLane =
"first";
1144 libsumo::Vehicle::add(
id, routeID, vTypeID, depart, departLane, departPos, departSpeed);
1151 if (inputStorage.
readInt() != 14) {
1154 std::string routeID;
1158 std::string vTypeID;
1166 std::string departLane;
1170 std::string departPos;
1174 std::string departSpeed;
1178 std::string arrivalLane;
1182 std::string arrivalPos;
1186 std::string arrivalSpeed;
1190 std::string fromTaz;
1210 libsumo::Vehicle::add(
id, routeID, vTypeID, depart, departLane, departPos, departSpeed, arrivalLane, arrivalPos, arrivalSpeed,
1211 fromTaz, toTaz, line, personCapacity, personNumber);
1219 libsumo::Vehicle::remove(
id, (
char)why);
1226 const int numArgs = inputStorage.
readInt();
1227 if (numArgs < 5 || numArgs > 7) {
1256 int keepRouteFlag = 1;
1262 double matchThreshold = 100;
1268 libsumo::Vehicle::moveToXY(
id, edgeID, laneNum, x, y, angle, keepRouteFlag, matchThreshold);
1276 libsumo::Vehicle::setSpeedFactor(
id, factor);
1284 libsumo::Vehicle::setLine(
id, line);
1288 std::vector<std::string> edgeIDs;
1292 libsumo::Vehicle::setVia(
id, edgeIDs);
1311 libsumo::Vehicle::setParameter(
id, name, value);
1322 const int itemNo = inputStorage.
readInt();
1344 double duration = -1;
1356 libsumo::Vehicle::highlight(
id, col, size, alphaMax, duration, type);
1360 std::vector<std::string> reservations;
1364 libsumo::Vehicle::dispatchTaxi(
id, reservations);
1372 if (fabs(value) == std::numeric_limits<double>::infinity()) {
1375 bool resetActionOffset = value >= 0.0;
1376 libsumo::Vehicle::setActionStepLength(
id, fabs(value), resetActionOffset);
1384 libsumo::Vehicle::setLateralLanePosition(
id, value);
1388 libsumo::Vehicle::updateBestLanes(
id);
1396 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
1399 libsumo::Vehicle::setMinGapLat(
id, value);