Skip to content

Commit

Permalink
optimized network params
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Oct 31, 2023
1 parent b975750 commit 471468c
Show file tree
Hide file tree
Showing 13 changed files with 10,274 additions and 23 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,11 @@ $p/berlin-v6.1-network.xml.gz: input/sumo.net.xml

$(sc) prepare clean-network $@ --output $@ --modes car

$(sc) prepare sample-network --network $@
#$(sc) prepare sample-network --network $@

# To update features and params, running python code is necessary
$(sc) prepare network-params --network $@ --input-features input/sumo.net-edges.csv.gz --output $@

$(sc) prepare network-freespeed --network $@ --params input/network-params.json --output $@
#$(sc) prepare network-params --network $@ --input-features input/sumo.net-edges.csv.gz --output $@
#$(sc) prepare network-freespeed --network $@ --params input/network-params.json --output $@

$p/berlin-v6.1-network-with-pt.xml.gz: $p/berlin-v6.1-network.xml.gz
$(sc) prepare transit-from-gtfs --network $< --output=$p\
Expand Down
8 changes: 4 additions & 4 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-PR2738</version>
<!-- <version>16.0-PR2738</version>-->

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

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -145,12 +145,12 @@
<dependency>
<groupId>de.topobyte</groupId>
<artifactId>osm4j-pbf</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>de.topobyte</groupId>
<artifactId>osm4j-geometry</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
</dependency>

<dependency>
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/org/matsim/prepare/network/BerlinNetworkParams.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.matsim.prepare.network;

import org.matsim.application.prepare.network.opt.FeatureRegressor;
import org.matsim.application.prepare.network.opt.NetworkModel;

public class BerlinNetworkParams implements NetworkModel {
@Override
public FeatureRegressor capacity(String junctionType) {
return switch (junctionType) {
case "traffic_light" -> BerlinNetworkParams_capacity_traffic_light.INSTANCE;
case "right_before_left" -> BerlinNetworkParams_capacity_right_before_left.INSTANCE;
case "priority" -> BerlinNetworkParams_capacity_priority.INSTANCE;
default -> throw new IllegalArgumentException("Unknown type: " + junctionType);
};
}

@Override
public FeatureRegressor speedFactor(String junctionType) {
return switch (junctionType) {
case "traffic_light" -> BerlinNetworkParams_speedRelative_traffic_light.INSTANCE;
case "right_before_left" -> BerlinNetworkParams_speedRelative_right_before_left.INSTANCE;
case "priority" -> BerlinNetworkParams_speedRelative_priority.INSTANCE;
default -> throw new IllegalArgumentException("Unknown type: " + junctionType);
};
}
}

Large diffs are not rendered by default.

Loading

0 comments on commit 471468c

Please sign in to comment.