Skip to content

Commit

Permalink
revert roadpricing, minimize impact of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl committed Nov 17, 2023
1 parent 2719424 commit a3e5d10
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ final class PlansReplanningImpl implements PlansReplanning, ReplanningListener {

@Override
public void notifyReplanning(final ReplanningEvent event) {
population.getPersons().values().forEach(ReplanningUtils::setInitialPlan);
conflictManager.initializeReplanning(population);
strategyManager.run(population, event.getIteration(), replanningContextProvider.get());
conflictManager.run(population, event.getIteration());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public ConflictManager(Set<ConflictResolver> resolvers, ConflictWriter writer, R
this.random = random;
this.writer = writer;
}

public void initializeReplanning(Population population) {
if (resolvers.size() > 0) { // only require if active
population.getPersons().values().forEach(ReplanningUtils::setInitialPlan);
}
}

public void run(Population population, int iteration) {
if (resolvers.size() == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ConflictManager provideConflictManager(Set<ConflictResolver> resolvers, Conflict
+ ". This will likely cause problems with the conflict logic if you are not sure what you are doing.");
}

Random random = MatsimRandom.getLocalInstance();
Random random = MatsimRandom.getRandom(); // no need for local instance, not parallel!
return new ConflictManager(resolvers, writer, random);
}

Expand Down

0 comments on commit a3e5d10

Please sign in to comment.