Skip to content

Commit

Permalink
bump to PR3496
Browse files Browse the repository at this point in the history
  • Loading branch information
simei94 committed Sep 30, 2024
1 parent bdbd9f9 commit abd8e91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!--<version>14.0-PR1452</version>-->

<!-- snapshot == not recommended: rather use PR-labelled release!-->
<version>2025.0-PR3486</version>
<version>2025.0-PR3496</version>
</parent>


Expand Down Expand Up @@ -144,7 +144,7 @@
<configuration>
<forkMode>once</forkMode>
<!-- avoid out of memory errors: -->
<argLine>@{argLine} -Xmx6500m -Djava.awt.headless=true -Dmatsim.preferLocalDtds=true</argLine>
<argLine>@{argLine} -Djava.awt.headless=true -Dmatsim.preferLocalDtds=true</argLine>
<!--necessary in tu berlin gitlab. BUT not good in other places, so solve by command line switch only where needed. kai, nov'18-->
<!--<useSystemClassLoader>false</useSystemClassLoader>-->
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.matsim.run.scenarios;

import com.google.common.collect.Lists;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.population.*;
import org.matsim.application.prepare.population.CleanPopulation;
import org.matsim.core.config.Config;
import org.matsim.core.config.groups.ReplanningConfigGroup;
import org.matsim.core.controler.Controler;
Expand Down Expand Up @@ -65,26 +65,21 @@ public void prepareScenario(Scenario scenario) {
// apply all scenario changes from base scenario class
baseScenario.prepareScenario(scenario);

// TODO: replace code segment that selects, cleans routes and converts trips 2 legs with call of CleanPopulation PR3496
TripsToLegsAlgorithm trips2Legs = new TripsToLegsAlgorithm(new RoutingModeMainModeIdentifier());

for (Person person : scenario.getPopulation().getPersons().values()) {
if (!person.getAttributes().getAttribute("subpopulation").equals("person")) {
continue;
}

Plan selected = person.getSelectedPlan();
for (Plan plan : Lists.newArrayList(person.getPlans())) {
if (plan != selected)
person.removePlan(plan);
}
CleanPopulation.removeUnselectedPlans(person);

for (Plan plan : person.getPlans()) {
trips2Legs.run(plan);

for (PlanElement el : plan.getPlanElements()) {
if (el instanceof Leg leg) {
leg.setRoute(null);
CleanPopulation.removeRouteFromLeg(el);
leg.setMode(mode);
}
}
Expand Down

0 comments on commit abd8e91

Please sign in to comment.