Skip to content

Commit

Permalink
update RunAccessibilityKelheim to be able to run without shape file; …
Browse files Browse the repository at this point in the history
…updated the destination activity facility to train station; finally, turned on drt accessibility calculation.
  • Loading branch information
jakobrehmann committed May 7, 2024
1 parent 5dbf69d commit b5cc565
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<artifactId>matsim-all</artifactId>

<!-- PR-labelled release -->
<version>16.0-PR2878</version>
<!-- <version>16.0-PR2878</version>-->

<!-- snapshot == not recommended: rather use PR-labelled release!-->
<!-- <version>16.0-SNAPSHOT</matsim.version>-->
<version>16.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
/**
* @author nagel
*/
final public class RunAccessibility {
final public class RunAccessibilityKelheim {
// do not change name of class; matsim book refers to it. kai, dec'14

private static final Logger LOG = LogManager.getLogger(RunAccessibility.class);
private static final Logger LOG = LogManager.getLogger(RunAccessibilityKelheim.class);


// use contribs/accessibility/examples/RunAccessibilityExample/config.xml
Expand All @@ -62,11 +62,19 @@ public static void main(String[] args) {
// config.plans().setInputFile(null);

AccessibilityConfigGroup accConfig = ConfigUtils.addOrGetModule(config, AccessibilityConfigGroup.class ) ;
accConfig.setAreaOfAccessibilityComputation(AccessibilityConfigGroup.AreaOfAccesssibilityComputation.fromShapeFile);
accConfig.setShapeFileCellBasedAccessibility("/Users/jakob/Downloads/solid_gitter/solid_gitter.shp");
// accConfig.setAreaOfAccessibilityComputation(AccessibilityConfigGroup.AreaOfAccesssibilityComputation.fromShapeFile);
// accConfig.setShapeFileCellBasedAccessibility("/Users/jakob/Downloads/solid_gitter/solid_gitter.shp");
accConfig.setAreaOfAccessibilityComputation(AccessibilityConfigGroup.AreaOfAccesssibilityComputation.fromBoundingBox);
accConfig.setBoundingBoxBottom(5377867.28);
accConfig.setBoundingBoxTop(5437403.93);
accConfig.setBoundingBoxLeft(669291.71);
accConfig.setBoundingBoxRight(736909.25);
accConfig.setTileSize_m(500);
accConfig.setTimeOfDay(14 * 60 * 60.);
accConfig.setComputingAccessibilityForMode(Modes4Accessibility.freespeed, true);
accConfig.setComputingAccessibilityForMode(Modes4Accessibility.car, true);
accConfig.setComputingAccessibilityForMode(Modes4Accessibility.estimatedDrt, true);



Scenario scenario = ScenarioUtils.loadScenario( config ) ;
Expand All @@ -75,7 +83,7 @@ public static void main(String[] args) {

// add facilities
ActivityFacilitiesFactory af = scenario.getActivityFacilities().getFactory();
ActivityFacility fac1 = af.createActivityFacility(Id.create("xxx", ActivityFacility.class), new Coord(710934.0800000001,5422522.85));
ActivityFacility fac1 = af.createActivityFacility(Id.create("xxx", ActivityFacility.class), new Coord(715041.71, 5420617.28));
ActivityOption ao = af.createActivityOption("shop");
fac1.addActivityOption(ao);
scenario.getActivityFacilities().addActivityFacility(fac1);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/matsim/run/RunKelheimScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected Config prepareConfig(Config config) {
sw.defaultParams().shp = "../shp/dilutionArea.shp";
sw.defaultParams().mapCenter = "11.89,48.91";
sw.defaultParams().mapZoomLevel = 11d;
sw.defaultParams().sampleSize = sample.getSample();
sw.sampleSize = sample.getSample();

if (intermodal) {
ConfigUtils.addOrGetModule(config, PtIntermodalRoutingModesConfigGroup.class);
Expand Down

0 comments on commit b5cc565

Please sign in to comment.