Skip to content

Commit

Permalink
Merge pull request #3441 from moia-oss/updatePrebookingRejections
Browse files Browse the repository at this point in the history
update prebooking rejection handling
  • Loading branch information
nkuehnel authored Sep 2, 2024
2 parents a8540db + 958577c commit be69aef
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
import org.matsim.api.core.v01.events.handler.PersonStuckEventHandler;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.population.Activity;
import org.matsim.api.core.v01.population.Leg;
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.Plan;
import org.matsim.api.core.v01.population.*;
import org.matsim.contrib.drt.passenger.AcceptedDrtRequest;
import org.matsim.contrib.drt.prebooking.unscheduler.RequestUnscheduler;
import org.matsim.contrib.dvrp.fleet.DvrpVehicle;
Expand Down Expand Up @@ -398,10 +395,9 @@ private void processRejections(double now) {
if(abortRejectedPrebookings) {
for (Id<Person> passengerId : item.request.getPassengerIds()) {
MobsimAgent agent = internalInterface.getMobsim().getAgents().get(passengerId);
((Activity) WithinDayAgentUtils.getCurrentPlanElement(agent)).setEndTime(Double.POSITIVE_INFINITY);
((Activity) WithinDayAgentUtils.getCurrentPlanElement(agent)).setMaximumDurationUndefined();
((HasModifiablePlan) agent).resetCaches();
internalInterface.getMobsim().rescheduleActivityEnd(agent);
agent.setStateToAbort(mobsimTimer.getTimeOfDay());
internalInterface.arrangeNextAgentState(agent);
eventsManager.processEvent(new PersonStuckEvent(now, agent.getId(), agent.getCurrentLinkId(),
this.mode));
internalInterface.getMobsim().getAgentCounter().incLost();
Expand Down

0 comments on commit be69aef

Please sign in to comment.