Skip to content

Commit

Permalink
remove vehicles from transfer before forcing their insertion #1922
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Apr 9, 2024
1 parent 842fe20 commit a94f43d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libsumo/Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <microsim/MSStop.h>
#include <microsim/MSVehicle.h>
#include <microsim/MSVehicleControl.h>
#include <microsim/MSVehicleTransfer.h>
#include <microsim/MSVehicleType.h>
#include <microsim/MSInsertionControl.h>
#include <microsim/MSNet.h>
Expand Down Expand Up @@ -2164,6 +2165,7 @@ Vehicle::moveTo(const std::string& vehID, const std::string& laneID, double posi
veh->resetRoutePosition(newRouteIndex, veh->getParameter().departLaneProcedure);
if (!veh->isOnRoad()) {
MSNet::getInstance()->getInsertionControl().alreadyDeparted(veh);
MSVehicleTransfer::getInstance()->remove(veh);
}
MSMoveReminder::Notification moveReminderReason;
if (veh->hasDeparted()) {
Expand Down
3 changes: 3 additions & 0 deletions src/microsim/MSVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,9 @@ MSVehicle::Influencer::postProcessRemoteControl(MSVehicle* v) {
MSMoveReminder::Notification notify = v->getDeparture() == NOT_YET_DEPARTED
? MSMoveReminder::NOTIFICATION_DEPARTED
: MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED;
if (!v->isOnRoad()) {
MSVehicleTransfer::getInstance()->remove(v); // TODO may need optimization, this is linear in the number of vehicles in transfer
}
myRemoteLane->forceVehicleInsertion(v, myRemotePos, notify, myRemotePosLat);
v->updateBestLanes();
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/vehicle/SUMOVehicleParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,7 @@ SUMOVehicleParameter::getArrivalSpeed() const {
return val;
}


void
SUMOVehicleParameter::incrementFlow(double scale, SumoRNG* rng) {
repetitionsDone++;
Expand Down

0 comments on commit a94f43d

Please sign in to comment.