Skip to content

Commit

Permalink
fixed bug in reading in facilities. Set up class to analyse two facil…
Browse files Browse the repository at this point in the history
…ity types.
  • Loading branch information
jakobrehmann committed May 23, 2024
1 parent 83e6ca5 commit cef8194
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/main/java/org/matsim/run/RunKelheimScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ protected void prepareScenario(Scenario scenario) {
ActivityFacility fac = af.createActivityFacility(Id.create(id, ActivityFacility.class), new Coord(x, y));
ActivityOption ao = af.createActivityOption(type);
fac.addActivityOption(ao);
scenario.getActivityFacilities().addActivityFacility(fac);


}
} catch (IOException e) {
Expand Down Expand Up @@ -479,9 +481,13 @@ public void handleEvent(PersonDepartureEvent event) {
}

if (acc) {
final AccessibilityModule module = new AccessibilityModule();
module.setConsideredActivityType("train station");
controler.addOverridingModule(module);
final AccessibilityModule moduleTrain = new AccessibilityModule();
moduleTrain.setConsideredActivityType("train station");
controler.addOverridingModule(moduleTrain);

final AccessibilityModule moduleHosp = new AccessibilityModule();
moduleHosp.setConsideredActivityType("hospital");
controler.addOverridingModule(moduleHosp);
}
}
}
4 changes: 3 additions & 1 deletion testOsmFacilitiesList.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
id,x,y,type
1,715041.71,5420617.28,'train station'
1,715041.71,5420617.28,"train station"
2,709518.98,5423088.09,"train station"
3,711964.02,5421948.65,"hospital"

0 comments on commit cef8194

Please sign in to comment.