Skip to content

Commit

Permalink
Filter input car network
Browse files Browse the repository at this point in the history
  • Loading branch information
CorinStaves committed Dec 27, 2023
1 parent 73fc95d commit 0709538
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/diary/RunRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void main(String[] args) throws IOException, FactoryException {
throw new RuntimeException("Program requires 2 arguments: \n" +
"(0) Properties file \n" +
"(1) Route data output (.csv) \n" +
"(2) Link data output (specify .gpkg OR write \"true\" to include links in csv file) \n");
"(2) Link data output (specify .gpkg OR write \"true\" to include links in csv file. Otherwise write \"false\") \n");
}

Resources.initializeResources(args[0]);
Expand Down Expand Up @@ -82,8 +82,9 @@ public static void main(String[] args) throws IOException, FactoryException {

// Create car networks
logger.info("Creating mode-specific networks...");
Network networkCar = NetworkUtils.createNetwork();
new MatsimNetworkReader(networkCar).readFile(Resources.instance.getString(Properties.MATSIM_CAR_NETWORK));
Network networkCarInput = NetworkUtils.createNetwork();
new MatsimNetworkReader(networkCarInput).readFile(Resources.instance.getString(Properties.MATSIM_CAR_NETWORK));
Network networkCar = NetworkUtils2.extractModeSpecificNetwork(networkCarInput, TransportMode.car);
Network carXy2l = NetworkUtils2.extractXy2LinksNetwork(networkCar, l -> !((boolean) l.getAttributes().getAttribute("motorway")));

// Create active mode networks
Expand All @@ -98,7 +99,6 @@ public static void main(String[] args) throws IOException, FactoryException {
// Travel time
FreespeedTravelTimeAndDisutility freeSpeed = new FreespeedTravelTimeAndDisutility(config.planCalcScore());
TravelTime ttBikeFast = bicycle.getTravelTimeFast(networkBike,bike);
TravelTime ttBike = bicycle.getTravelTime();
TravelTime ttWalk = new WalkTravelTime();

// Car freespeed & congested travel time
Expand All @@ -114,7 +114,7 @@ public static void main(String[] args) throws IOException, FactoryException {
// CALCULATOR
RouteIndicatorCalculator calc = new RouteIndicatorCalculator(trips);

// // beeline
// beeline
calc.beeline("beeline", ORIGIN, DESTINATION);

// car
Expand All @@ -125,7 +125,7 @@ public static void main(String[] args) throws IOException, FactoryException {
// calc.network("bike_jibe_day", ORIGIN, DESTINATION, bike, networkBike, networkBike, new JibeDisutility3Fast(networkBike,bike,TransportMode.bike,ttBikeFast,true), ttBike, null,savePath);
// calc.network("bike_jibe_night", ORIGIN, DESTINATION, bike, networkBike, networkBike, new JibeDisutility3Fast(networkBike,bike,TransportMode.bike,ttBikeFast,false), ttBike, null,savePath);
calc.network("bike_short", ORIGIN, DESTINATION, bike, networkBike, networkBike, new DistanceDisutility(), ttBikeFast, ActiveAttributes.getJibeDist(TransportMode.bike),savePath);
calc.network("bike_fast", ORIGIN, DESTINATION, bike, networkBike, networkBike, new OnlyTimeDependentTravelDisutility(ttBikeFast), ttBike, ActiveAttributes.getJibeTime(TransportMode.bike,bike),savePath);
calc.network("bike_fast", ORIGIN, DESTINATION, bike, networkBike, networkBike, new OnlyTimeDependentTravelDisutility(ttBikeFast), ttBikeFast, ActiveAttributes.getJibeTime(TransportMode.bike,bike),savePath);

// walk
// calc.network("walk_jibe_day", ORIGIN, DESTINATION, null, networkWalk, networkWalk, new JibeDisutility3Fast(networkWalk,null,TransportMode.walk,ttWalk,true), ttWalk, null, savePath);
Expand All @@ -135,7 +135,7 @@ public static void main(String[] args) throws IOException, FactoryException {

// // public transport
// calc.pt("pt", ORIGIN, DESTINATION, config, transitScheduleFilePath, transitNetworkFilePath);

//
// // Activity-based modelling calculations (not relevant for JIBE)
// calc.beeline("beeline_hs", HOME, DESTINATION);
// calc.beeline("beeline_sm", DESTINATION, MAIN);
Expand Down

0 comments on commit 0709538

Please sign in to comment.