Skip to content

Commit

Permalink
Minor updates re simulating demand in MATSim
Browse files Browse the repository at this point in the history
  • Loading branch information
CorinStaves committed Aug 26, 2024
1 parent 271123b commit d798cb2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package network;
package demand;

import network.NetworkUtils2;
import network.WriteNetworkGpkgSimple;
import org.apache.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.TransportMode;
Expand All @@ -18,10 +20,10 @@
import java.util.List;
import java.util.Set;

public class CreateMatsimNetworkVehicle {
public class CreateVehicleNetwork {
private final static double URBAN_NONPRIMARY_CAPACITY_REDUCTION_FACTOR = 0.25;
private final static double URBAN_NONPRIMARY_FREESPEED_REDUCTION_FACTOR = 0.25;
private final static Logger log = Logger.getLogger(CreateMatsimNetworkVehicle.class);
private final static Logger log = Logger.getLogger(CreateVehicleNetwork.class);
private static final List<String> PAIRS_TO_CONNECT = List.of("227825out","224795out","164749out","298027out",
"220563out","128831out","367168out","273137out","124102out","124103out","81480out","8582out","4084out","4083out",
"224706out","419out","206836out","8823out","349287out","13111out","409267out","409269out","58003out","58867out");
Expand All @@ -45,13 +47,14 @@ public static void main(String[] args) throws FactoryException, IOException {
createConnectors(vehicleNetwork);
NetworkUtils.runNetworkCleaner(vehicleNetwork);

// Double capacity of short links
for (Link link : vehicleNetwork.getLinks().values()) {

// Double capacity of short links
if(link.getLength() < 100.) {
link.setCapacity(2 * link.getCapacity());
}

// REDUCE CAPACITY AND FREESPEED OF URBAN NON-PRIMARY LINKS
boolean urban = (boolean) link.getAttributes().getAttribute("urban");
boolean primary = (boolean) link.getAttributes().getAttribute("primary");
if(urban && !primary) {
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/resources/example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ matsim.road.network = network/network.xml
matsim.car.network = network/network_car.xml
matsim.transit.network = pt/ptNetwork.xml
matsim.transit.schedule = pt/scheduleMapped.xml

# Inputs for MATSim simulation
matsim.demand.scale.factor = 0.1
matsim.demand.config = config.xml
matsim.demand.vehicles = demand/mode-vehicles.xml
matsim.demand.plans = demand/tfgmPlans.xml

# Outputs from Initial MATSim run
# Outputs from MATSim simulation (for network attributes and estimating travel times)
matsim.demand.output.scale.factor = 0.25
matsim.demand.output.network = output/output_network.xml
matsim.demand.output.events = output/output_events.xml.gz
matsim.demand.output.vehicles = output/output_vehicles.xml.gz

Expand Down Expand Up @@ -51,14 +54,15 @@ diary.origin.y = StartNorthing
diary.destination.x = EndEasting
diary.destination.y = EndNorthing

# Default parameters for walk JIBE routing
mc.walk.gradient = 3
# Default parameters for walk routing
mc.walk.gradient = 4
mc.walk.comfort = 0
mc.walk.ambience = 3
mc.walk.stress = 1

# Default parameters for bike JIBE routing
# Default parameters for bike routing
mc.bike.gradient = 15
mc.bike.comfort = 0.15
mc.bike.ambience = 1
mc.bike.stress = 3

0 comments on commit d798cb2

Please sign in to comment.