80 std::string warning =
"";
124 std::cout <<
SIMTIME <<
" processSet veh=" <<
id <<
"\n";
128 if (sumoVehicle ==
nullptr) {
134 if (v ==
nullptr && shouldExist) {
143 int compoundSize = inputStorage.
readInt();
144 if (compoundSize < 4 || compoundSize > 7) {
166 if (compoundSize >= 5) {
172 if (compoundSize >= 6) {
178 if (compoundSize >= 7) {
183 libsumo::Vehicle::setStop(
id, edgeID, pos, laneIndex, duration, stopFlags, startPos, until);
201 int compoundSize = inputStorage.
readInt();
202 if (compoundSize != 3 && compoundSize != 4) {
205 const int nextStopIndex =
StoHelp::readTypedInt(inputStorage,
"The first setStopParameter parameter must be the nextStopIndex given as an integer.");
215 if (compoundSize == 4) {
220 libsumo::Vehicle::setStopParameter(
id, nextStopIndex, param, value, customParam != 0);
228 int compoundSize = inputStorage.
readInt();
229 if (compoundSize != 1) {
232 std::string parkingAreaID;
236 libsumo::Vehicle::rerouteParkingArea(
id, parkingAreaID);
244 if (inputStorage.
readInt() != 0) {
248 libsumo::Vehicle::resume(
id);
255 int compounds = inputStorage.
readInt();
256 if (compounds != 3 && compounds != 2) {
265 double duration = 0.;
271 if (compounds == 3) {
277 if ((laneIndex < 0 || laneIndex >= (
int)v->
getEdge()->
getLanes().size()) && relative < 1) {
282 libsumo::Vehicle::changeLane(
id, laneIndex, duration);
284 libsumo::Vehicle::changeLaneRelative(
id, laneIndex, duration);
293 libsumo::Vehicle::changeSublane(
id, latDist);
300 if (inputStorage.
readInt() != 2) {
310 double duration = 0.;
317 libsumo::Vehicle::slowDown(
id, newSpeed, duration);
325 libsumo::Vehicle::changeTarget(
id, edgeID);
332 const int nParameter = inputStorage.
readInt();
333 if (nParameter != 5 && nParameter != 6) {
336 double newTimeHeadway = 0;
340 double newSpaceHeadway = 0;
344 double duration = 0.;
348 double changeRate = 0;
357 if (newTimeHeadway == -1 && newSpaceHeadway == -1 && duration == -1 && changeRate == -1 && maxDecel == -1) {
358 libsumo::Vehicle::deactivateGapControl(
id);
360 if (newTimeHeadway <= 0) {
361 if (newTimeHeadway != -1) {
365 if (newSpaceHeadway < 0) {
371 if (changeRate <= 0) {
377 std::string refVehID =
"";
378 if (nParameter == 6) {
383 libsumo::Vehicle::openGap(
id, newTimeHeadway, newSpaceHeadway, duration, changeRate, maxDecel, refVehID);
392 libsumo::Vehicle::setType(
id, vTypeID);
400 libsumo::Vehicle::setRouteID(
id, rid);
404 std::vector<std::string> edgeIDs;
408 libsumo::Vehicle::setRoute(
id, edgeIDs);
415 int parameterCount = inputStorage.
readInt();
418 double endTime = std::numeric_limits<double>::max();
420 if (parameterCount == 4) {
437 }
else if (parameterCount == 2) {
446 }
else if (parameterCount == 1) {
454 libsumo::Vehicle::setAdaptedTraveltime(
id, edgeID, value, begTime, endTime);
461 int parameterCount = inputStorage.
readInt();
464 double endTime = std::numeric_limits<double>::max();
466 if (parameterCount == 4) {
483 }
else if (parameterCount == 2) {
491 }
else if (parameterCount == 1) {
500 libsumo::Vehicle::setEffort(
id, edgeID, value, begTime, endTime);
507 if (inputStorage.
readInt() != 0) {
510 libsumo::Vehicle::rerouteTraveltime(
id,
false);
517 if (inputStorage.
readInt() != 0) {
520 libsumo::Vehicle::rerouteEffort(
id);
524 libsumo::Vehicle::setSignals(
id,
StoHelp::readTypedInt(inputStorage,
"Setting signals requires an integer."));
530 const int numArgs = inputStorage.
readInt();
531 if (numArgs < 2 || numArgs > 3) {
546 reason =
StoHelp::readTypedInt(inputStorage,
"The third parameter for setting a position must be the reason given as an int.");
549 libsumo::Vehicle::moveTo(
id, laneID, position, reason);
553 double impatience = 0;
557 libsumo::Vehicle::setImpatience(
id, impatience);
565 libsumo::Vehicle::setSpeed(
id, speed);
573 int parameterCount = inputStorage.
readInt();
574 if (parameterCount == 2) {
590 libsumo::Vehicle::setAcceleration(
id, accel, duration);
594 double prevSpeed = 0;
599 int parameterCount = inputStorage.
readInt();
600 if (parameterCount == 2) {
607 }
else if (parameterCount == 1) {
623 libsumo::Vehicle::setPreviousSpeed(
id, prevSpeed, prevAcceleration);
627 libsumo::Vehicle::setSpeedMode(
id,
StoHelp::readTypedInt(inputStorage,
"Setting speed mode requires an integer."));
630 libsumo::Vehicle::setLaneChangeMode(
id,
StoHelp::readTypedInt(inputStorage,
"Setting lane change mode requires an integer."));
633 libsumo::Vehicle::setRoutingMode(
id,
StoHelp::readTypedInt(inputStorage,
"Setting routing mode requires an integer."));
640 libsumo::Vehicle::setColor(
id, col);
647 if (inputStorage.
readInt() != 6) {
658 const int departCode =
StoHelp::readTypedInt(inputStorage,
"Third parameter (depart) requires an integer.");
661 depart =
"triggered";
663 depart =
"containerTriggered";
672 double departPosCode;
676 std::string departPos =
toString(departPosCode);
678 departPos =
"random";
680 departPos =
"random_free";
691 double departSpeedCode;
695 std::string departSpeed =
toString(departSpeedCode);
697 departSpeed =
"random";
701 departSpeed =
"desired";
703 departSpeed =
"speedLimit";
705 departSpeed =
"last";
714 std::string departLane =
toString(departLaneCode);
716 departLane =
"random";
720 departLane =
"allowed";
724 departLane =
"first";
726 libsumo::Vehicle::add(
id, routeID, vTypeID, depart, departLane, departPos, departSpeed);
733 if (inputStorage.
readInt() != 14) {
748 std::string departLane;
752 std::string departPos;
756 std::string departSpeed;
760 std::string arrivalLane;
764 std::string arrivalPos;
768 std::string arrivalSpeed;
784 const int personCapacity =
StoHelp::readTypedInt(inputStorage,
"13th parameter (person capacity) requires an int.");
785 const int personNumber =
StoHelp::readTypedInt(inputStorage,
"14th parameter (person number) requires an int.");
786 libsumo::Vehicle::add(
id, routeID, vTypeID, depart, departLane, departPos, departSpeed, arrivalLane, arrivalPos, arrivalSpeed,
787 fromTaz, toTaz, line, personCapacity, personNumber);
795 libsumo::Vehicle::remove(
id, (
char)why);
802 const int numArgs = inputStorage.
readInt();
803 if (numArgs < 5 || numArgs > 7) {
810 const int laneIndex =
StoHelp::readTypedInt(inputStorage,
"The second parameter for moveToXY must be lane given as an int.");
824 int keepRouteFlag = 1;
830 double matchThreshold = 100;
836 libsumo::Vehicle::moveToXY(
id, edgeID, laneIndex, x, y, angle, keepRouteFlag, matchThreshold);
844 libsumo::Vehicle::setSpeedFactor(
id, factor);
852 libsumo::Vehicle::setLine(
id, line);
856 std::vector<std::string> edgeIDs;
860 libsumo::Vehicle::setVia(
id, edgeIDs);
879 libsumo::Vehicle::setParameter(
id, name, value);
890 const int itemNo = inputStorage.
readInt();
912 double duration = -1;
924 libsumo::Vehicle::highlight(
id, col, size, alphaMax, duration, type);
928 std::vector<std::string> reservations;
932 libsumo::Vehicle::dispatchTaxi(
id, reservations);
940 if (fabs(value) == std::numeric_limits<double>::infinity()) {
943 bool resetActionOffset = value >= 0.0;
944 libsumo::Vehicle::setActionStepLength(
id, fabs(value), resetActionOffset);
952 libsumo::Vehicle::setLateralLanePosition(
id, value);
956 libsumo::Vehicle::updateBestLanes(
id);
964 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
967 libsumo::Vehicle::setMinGap(
id, value);
975 if (value < 0.0 || fabs(value) == std::numeric_limits<double>::infinity()) {
978 libsumo::Vehicle::setMinGapLat(
id, value);