Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
add networkMode to vehicleType.
Browse files Browse the repository at this point in the history
  • Loading branch information
kt86 committed Nov 12, 2024
1 parent 3c091b6 commit e0dda3a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.jetbrains.annotations.NotNull;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.network.Link;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
Expand Down Expand Up @@ -111,6 +112,10 @@ public static void main(String[] args) {
CarrierVehicleTypes vehicleTypes = new CarrierVehicleTypes();
CarrierVehicleTypeReader vehicleTypeReader = new CarrierVehicleTypeReader(vehicleTypes);
vehicleTypeReader.readFile(VEHICLE_TYPE_FILE);
//The following is needed, because sinde fall 2024 the vehicle types are not assigned to a network mode by default.
for (VehicleType vehicleType : vehicleTypes.getVehicleTypes().values()) {
vehicleType.setNetworkMode(TransportMode.car);
}

Carriers carriers = new Carriers();
CarrierPlanXmlReader carrierReader = new CarrierPlanXmlReader(carriers, vehicleTypes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.matsim.analysis.personMoney.PersonMoneyEventsAnalysisModule;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.network.Link;
import org.matsim.contrib.roadpricing.*;
import org.matsim.core.config.Config;
Expand Down Expand Up @@ -95,6 +96,10 @@ public static void main(String[] args) {
CarrierVehicleTypes vehicleTypes = new CarrierVehicleTypes();
CarrierVehicleTypeReader vehicleTypeReader = new CarrierVehicleTypeReader(vehicleTypes);
vehicleTypeReader.readFile(VEHICLE_TYPE_FILE);
//The following is needed, because sinde fall 2024 the vehicle types are not assigned to a network mode by default.
for (VehicleType vehicleType : vehicleTypes.getVehicleTypes().values()) {
vehicleType.setNetworkMode(TransportMode.car);
}

Carriers carriers = new Carriers();
CarrierPlanXmlReader carrierReader = new CarrierPlanXmlReader(carriers, vehicleTypes);
Expand Down

0 comments on commit e0dda3a

Please sign in to comment.