Skip to content

Commit

Permalink
restructure and update the vehicleTypes for wasteCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
rewertvsp committed Dec 19, 2024
1 parent 2a6e9fd commit 3732e9a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 154 deletions.
72 changes: 0 additions & 72 deletions scenarios/wasteCollection/Berlin/vehicleTypes.xml

This file was deleted.

73 changes: 0 additions & 73 deletions scenarios/wasteCollection/Vulkaneifel/vehicles/vehicleTypes.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<maximumVelocity meterPerSecond="22.22222222222222"/>
<engineInformation>
<attributes>
<attribute name="energyCapacityInKWhOrLiters" class="java.lang.Double">125.0</attribute>
<attribute name="energyCapacityInKWhOrLiters" class="java.lang.Double">122.8</attribute> <!-- Original capacity of 155 is reduced by the consumption of 2 full collected capacities -->
<attribute name="energyConsumptionPerTonnePickupWaste" class="java.lang.Double">1.4</attribute>
<attribute name="energyConsumptionKWhPerMeter" class="java.lang.Double">0.001</attribute>
<attribute name="HbefaTechnology" class="java.lang.String">electricity</attribute>
Expand All @@ -55,7 +55,7 @@
<maximumVelocity meterPerSecond="22.22222222222222"/>
<engineInformation>
<attributes>
<attribute name="energyCapacityInKWhOrLiters" class="java.lang.Double">310.0</attribute>
<attribute name="energyCapacityInKWhOrLiters" class="java.lang.Double">280.6</attribute> <!-- Original capacity of 310 is reduced by the consumption of 2 full collected capacities -->
<attribute name="energyConsumptionPerTonnePickupWaste" class="java.lang.Double">1.4</attribute>
<attribute name="energyConsumptionKWhPerMeter" class="java.lang.Double">0.001</attribute>
<attribute name="HbefaTechnology" class="java.lang.String">electricity</attribute>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Run_Abfall {
private static final String original_Chessboard = "https://raw.githubusercontent.com/matsim-org/matsim/master/examples/scenarios/freight-chessboard-9x9/grid9x9.xml";
private static final String berlin = "https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/berlin-v5.2-1pct/output-berlin-v5.2-1pct/berlin-v5.2-1pct.output_network.xml.gz";
private static final String berlinDistrictsWithGarbageInformations = "scenarios/wasteCollection/Berlin/garbageInput/districtsWithGarbageInformations.shp";
private static final String inputVehicleTypes = "scenarios/wasteCollection/Berlin/vehicleTypes.xml";
private static final String inputVehicleTypes = "scenarios/wasteCollection/vehicleTypes.xml";
private static final String inputCarriersWithDieselVehicle = "scenarios/wasteCollection/Berlin/carriers_diesel_vehicle.xml";
private static final String inputCarriersWithMediumBatteryVehicle = "scenarios/wasteCollection/Berlin/carriers_medium_EV.xml";
private static final String inputCarriersWithSmallBatteryVehicle = "scenarios/wasteCollection/Berlin/carriers_small_EV.xml";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ public class AbfallUtils {
static String linkDepotPlaidt = "5574439310007f";
static String linkDepotHetzerath = "3118011660035f";

static String carrierVehicleTypesFilePath = "scenarios/wasteCollection/Vulkaneifel/vehicles/vehicleTypes_new.xml";

static Config prepareConfig(String output, String networkPath) {
static Config prepareConfig(String output, String networkPath, String vehicleTypesFilePath) {
Config config = ConfigUtils.createConfig();
config.routing().setNetworkRouteConsistencyCheck(RoutingConfigGroup.NetworkRouteConsistencyCheck.disable);
config.global().setCoordinateSystem("EPSG:25832");
Expand All @@ -47,8 +45,8 @@ static Config prepareConfig(String output, String networkPath) {
config.controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.overwriteExistingFiles);

FreightCarriersConfigGroup freightCarriersConfigGroup = ConfigUtils.addOrGetModule(config, FreightCarriersConfigGroup.class);
log.info("Read carrier vehicle types from: {}", carrierVehicleTypesFilePath);
freightCarriersConfigGroup.setCarriersVehicleTypesFile(carrierVehicleTypesFilePath);
log.info("Read carrier vehicle types from: {}", vehicleTypesFilePath);
freightCarriersConfigGroup.setCarriersVehicleTypesFile(vehicleTypesFilePath);

log.info("Read network from: {}", networkPath);
config.network().setInputFile(networkPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ enum VehicleFleet {
defaultValue = "scenarios/wasteCollection/Vulkaneifel/vulkaneifel_network_reduced.xml.gz")
private String networkPath;

@CommandLine.Option(names = "--vehicleTypesFile", description = "Path to the vehicle types file",
defaultValue = "scenarios/wasteCollection/vehicleTypes.xml")
static String vehicleTypesFilePath ;

public static void main(String[] args) {
System.exit(new CommandLine(new RunWasteCollectionVulkaneifel()).execute(args));
}
Expand All @@ -103,7 +107,7 @@ public Integer call() throws Exception {
String Output_suffix = "/" + weekday + "_" + weekRhythm + "_"+vehicleFleet + "_"+ "Iterations_"+ jspritIterations ;
output = output + Output_suffix;

Config config = AbfallUtils.prepareConfig(output, networkPath);
Config config = AbfallUtils.prepareConfig(output, networkPath, vehicleTypesFilePath);
Scenario scenario = ScenarioUtils.loadScenario(config);

FreightCarriersConfigGroup freightCarriersConfigGroup = ConfigUtils.addOrGetModule(config, FreightCarriersConfigGroup.class);
Expand Down

0 comments on commit 3732e9a

Please sign in to comment.