Commit 61e54de5 authored by Sebastian Hörl's avatar Sebastian Hörl
Browse files

Merge branch 'cleanup' into 'master'

Some code cleanup for mode choice and private AVs

See merge request ivt-vpl/astra_2018_002!4
parents e6abffff 49b0038f
# How to run a simulaton with private AVs
Private AVs can be activated via the `private_av` config group:
```xml
<module name="private_av">
<param name="usePrivateAVs" value="true" />
</module>
```
Likewise, this option can be set via the command line:
```
java [...] --config:private_av.usePrivateAVs true
```
# How to create the partial scenarios
This repository only contains code to run the requested scenarios in the ASTRA 2018/002 project. For the sake of avoiding code duplication, the scenario cutting code is still located in the [baseline_scenario](https://github.com/matsim-eth/baseline_scenario) repository, specifically in the (synpop)[https://github.com/matsim-eth/baseline_scenario/tree/synpop] branch.
......
package ch.ethz.matsim.projects.astra_2018_002;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Link;
public class ASTRAConfigurator {
static public void adjustNetwork(Scenario scenario) {
// TODO: only until we actually assign allowed modes via the pipeline
for (Link link : scenario.getNetwork().getLinks().values()) {
Set<String> allowedModes = new HashSet<>(link.getAllowedModes());
if (allowedModes.contains("car")) {
allowedModes.addAll(Arrays.asList("prav3", "prav4", "prav5"));
}
link.setAllowedModes(allowedModes);
}
}
}
......@@ -18,7 +18,7 @@ import com.google.inject.Singleton;
import ch.ethz.matsim.av.framework.AVQSimPlugin;
import ch.ethz.matsim.baseline_scenario.transit.simulation.BaselineTransitPlugin;
import ch.ethz.matsim.projects.astra_2018_002.av.dynamics.AVModesQSimPlugin;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.dynamics.AVModesQSimPlugin;
public class ASTRAQSimModule extends AbstractModule {
@Override
......
package ch.ethz.matsim.projects.astra_2018_002;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Link;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.controler.Controler;
......@@ -17,17 +12,17 @@ import ch.ethz.matsim.baseline_scenario.traffic.BaselineTrafficModule;
import ch.ethz.matsim.baseline_scenario.transit.BaselineTransitModule;
import ch.ethz.matsim.baseline_scenario.transit.routing.DefaultEnrichedTransitRoute;
import ch.ethz.matsim.baseline_scenario.transit.routing.DefaultEnrichedTransitRouteFactory;
import ch.ethz.matsim.projects.astra_2018_002.av.AVConfigurator;
import ch.ethz.matsim.projects.astra_2018_002.av.AssignPrivatAVs;
import ch.ethz.matsim.projects.astra_2018_002.flow_efficiency.FlowEfficiencyConfigurator;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.SwissDiscreteModeChoiceModule;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.SwissModeChoiceConfigurator;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.SwissUtilityParameters.UtilitySet;
import ch.ethz.matsim.projects.astra_2018_002.private_av.PrivateAVConfigurator;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.SharedAVConfigurator;
import ch.sbb.matsim.routing.pt.raptor.SwissRailRaptorModule;
public class RunASTRA2018002 {
static public void main(String[] args) throws ConfigurationException {
CommandLine cmd = new CommandLine.Builder(args) //
CommandLine cmd = new CommandLine.Builder(args) //
.requireOptions("config-path", "model") //
.allowOptions("use-route-choice", "use-only-significant", "utility-parameters", "crossing-penalty") //
.allowPrefixes(SwissDiscreteModeChoiceModule.COMMAND_LINE_PREFIX) //
......@@ -45,11 +40,11 @@ public class RunASTRA2018002 {
// Load config
Config config = ConfigUtils.loadConfig(cmd.getOptionStrict("config-path"));
// Adjust config
// Adjust config (they need to stay in the correct order!)
SwissModeChoiceConfigurator.configure(config);
FlowEfficiencyConfigurator.configure(config);
AVConfigurator.configure(config);
SharedAVConfigurator.configure(config);
PrivateAVConfigurator.configure(config);
cmd.applyConfiguration(config);
// Load scenario
......@@ -57,22 +52,11 @@ public class RunASTRA2018002 {
scenario.getPopulation().getFactory().getRouteFactories().setRouteFactory(DefaultEnrichedTransitRoute.class,
new DefaultEnrichedTransitRouteFactory());
ScenarioUtils.loadScenario(scenario);
// TODO: only until we actually assign allowed modes via the pipeline
for (Link link : scenario.getNetwork().getLinks().values()) {
Set<String> allowedModes = new HashSet<>(link.getAllowedModes());
if (allowedModes.contains("car")) {
allowedModes.addAll(Arrays.asList("prav3", "prav4", "prav5"));
}
link.setAllowedModes(allowedModes);
}
// Adjust scenario
SwissModeChoiceConfigurator.copyHousholdAttributes(scenario);
AssignPrivatAVs.main(scenario);
FlowEfficiencyConfigurator.defineVehicleTypes(scenario);
ASTRAConfigurator.adjustNetwork(scenario);
// Set up controller
Controler controller = new Controler(scenario);
......@@ -81,7 +65,7 @@ public class RunASTRA2018002 {
controller.addOverridingModule(new ASTRAModule());
controller.addOverridingModule(
new BaselineTrafficModule(cmd.getOption("crossing-penalty").map(Double::parseDouble).orElse(3.0)));
AVConfigurator.configureController(controller);
SharedAVConfigurator.configureController(controller);
UtilitySet utilitySet = Enum.valueOf(UtilitySet.class, cmd.getOptionStrict("model"));
boolean useRouteChoice = cmd.getOption("use-route-choice").map(Boolean::parseBoolean).orElse(true);
......
......@@ -11,7 +11,7 @@ import org.matsim.api.core.v01.population.Person;
import ch.ethz.matsim.discrete_mode_choice.model.DiscreteModeChoiceTrip;
import ch.ethz.matsim.discrete_mode_choice.model.mode_availability.CarModeAvailability;
import ch.ethz.matsim.projects.astra_2018_002.av.AssignPrivatAVs;
import ch.ethz.matsim.projects.astra_2018_002.private_av.AssignPrivatAVs;
public class SwissModeAvailability extends CarModeAvailability {
public SwissModeAvailability(Collection<String> modes) {
......@@ -21,7 +21,7 @@ public class SwissModeAvailability extends CarModeAvailability {
@Override
public Collection<String> getAvailableModes(Person person, List<DiscreteModeChoiceTrip> trips) {
boolean bikeAvailability = !"FOR_NONE".equals((String) person.getAttributes().getAttribute("bikeAvailability"));
Set<String> modes = new HashSet<>();
if (!bikeAvailability) {
......@@ -30,14 +30,13 @@ public class SwissModeAvailability extends CarModeAvailability {
} else {
modes.addAll(super.getAvailableModes(person, trips));
}
String pravAvailability = (String) person.getAttributes().getAttribute(AssignPrivatAVs.AV_AVAILABILITY_ATTRIBUTE);
if (!pravAvailability.equals("noPrav")) {
String pravAvailability = (String) person.getAttributes()
.getAttribute(AssignPrivatAVs.AV_AVAILABILITY_ATTRIBUTE);
if (pravAvailability != null && !pravAvailability.equals("noPrav")) {
modes.add(pravAvailability);
}
System.err.println(modes);
return modes;
}
......
......@@ -36,7 +36,7 @@ public class SwissModeChoiceConfigurator {
dmcConfig.setTripEstimator(SwissDiscreteModeChoiceModule.SWISS_ESTIMATOR_NAME);
dmcConfig.setTourEstimator(EstimatorModule.CUMULATIVE);
dmcConfig.setCachedModes(Arrays.asList("car", "bike", "pt", "walk", "prav3", "prav4", "prav5"));
dmcConfig.setCachedModes(Arrays.asList("car", "bike", "pt", "walk"));
dmcConfig.setTourFinder(TourFinderModule.ACTIVITY_BASED);
dmcConfig.getActivityTourFinderConfigGroup().setActivityType("home");
......@@ -49,12 +49,7 @@ public class SwissModeChoiceConfigurator {
dmcConfig.setTripConstraints(Arrays.asList(ConstraintModule.TRANSIT_WALK));
dmcConfig.getVehicleTourConstraintConfig().setHomeType(HomeType.USE_ACTIVITY_TYPE);
dmcConfig.getVehicleTourConstraintConfig().setRestrictedModes(Arrays.asList("car", "bike", "prav3", "prav4", "prav5"));
config.plansCalcRoute().setNetworkModes(Arrays.asList("car","prav3", "prav4", "prav5"));
config.qsim().setMainModes(Arrays.asList("car","prav3", "prav4", "prav5"));
config.travelTimeCalculator().setAnalyzedModes("car,prav3,prav4,prav5");
config.travelTimeCalculator().setSeparateModes(false);
dmcConfig.getVehicleTourConstraintConfig().setRestrictedModes(Arrays.asList("car", "bike"));
// These parameters are only used by SwissRailRaptor. We configure the
// parameters here in a way that SRR searches for the route with the shortest
......@@ -80,15 +75,6 @@ public class SwissModeChoiceConfigurator {
ModeRoutingParams walkParams = config.plansCalcRoute().getModeRoutingParams().get(TransportMode.walk);
walkParams.setBeelineDistanceFactor(1.3);
walkParams.setTeleportedModeSpeed(1.2); // 4.32 km/h
ModeParams prav3Params = new ModeParams("prav3");
config.planCalcScore().addModeParams(prav3Params);
ModeParams prav4Params = new ModeParams("prav4");
config.planCalcScore().addModeParams(prav4Params);
ModeParams prav5Params = new ModeParams("prav5");
config.planCalcScore().addModeParams(prav5Params);
}
static public void copyHousholdAttributes(Scenario scenario) {
......
......@@ -8,10 +8,11 @@ import org.matsim.pt.transitSchedule.api.TransitSchedule;
import ch.ethz.matsim.discrete_mode_choice.model.DiscreteModeChoiceTrip;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.base.BaseUtilityEstimator;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.base.PersonVariables;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.base.TripVariablesAv;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.base.TripVariablesBike;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.base.TripVariablesCar;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.base.TripVariablesPrivateAv;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.base.TripVariablesPt;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.base.TripVariablesSharedAv;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.base.TripVariablesWalk;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.cost.CostModel;
......@@ -203,8 +204,8 @@ public class SwissUtilityEstimator extends BaseUtilityEstimator {
}
@Override
public double estimateAvTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesAv tripVariables) {
public double estimateSharedAvTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesSharedAv tripVariables) {
double utility = 0.0;
// TODO: Right now we use utilties from car and waiting is not scored!
......@@ -232,19 +233,54 @@ public class SwissUtilityEstimator extends BaseUtilityEstimator {
}
@Override
public double estimatePrivateVehicleTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesCar tripVariables, String mode) {
public double estimatePrivateAVTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesPrivateAv tripVariables) {
double utility = 0.0;
double betaTravelTime = 0.0;
switch (tripVariables.automationLevel) {
case LEVEL3:
betaTravelTime = parameters.prav.betaTravelTimeLevel3;
break;
case LEVEL4:
betaTravelTime = parameters.prav.betaTravelTimeLevel4;
break;
case LEVEL5:
betaTravelTime = parameters.prav.betaTravelTimeLevel5;
break;
default:
throw new IllegalStateException();
}
utility += parameters.prav.alpha;
utility += betaTravelTime * tripVariables.travelTime_min;
utility += parameters.betaCost //
* interaction(tripVariables.crowflyDistance_km, parameters.referenceCrowflyDistance_km,
parameters.lambdaCostCrowflyDistance) //
* tripVariables.travelCost_CHF;
utility += parameters.walk.betaTravelTime * parameters.prav.constantAccessEgressWalkTime_min;
return utility;
}
@Override
public double estimateCarTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesCar tripVariables) {
double utility = 0.0;
utility += parameters.car.alpha;
// TODO: Consider private AV VOT here.
utility += parameters.car.betaTravelTime //
* interaction(tripVariables.travelDistance_km, parameters.referenceDistance_km,
parameters.car.lambdaTravelTimeDistance) //
* tripVariables.travelTime_min;
utility += parameters.car.betaParkingSearchTime * tripVariables.parkingSearchTime_min;
double parkingSearchTime_min = tripVariables.parkingSearchTime_min
+ parameters.car.constantParkingSearchPenalty_min;
utility += parameters.car.betaParkingSearchTime * parkingSearchTime_min;
utility += parameters.betaCost //
* interaction(tripVariables.travelDistance_km, parameters.referenceDistance_km,
parameters.car.lambdaCostDistance) //
......@@ -273,6 +309,8 @@ public class SwissUtilityEstimator extends BaseUtilityEstimator {
parameters.lambdaDelayDistance) //
* tripVariables.delay_min;
utility += parameters.walk.betaTravelTime * parameters.car.constantAccessEgressWalkTime_min;
return utility;
}
......
......@@ -112,7 +112,6 @@ public class SwissUtilityParameters {
public double betaTravelTime = 0.0;
public double betaParkingSearchTime = 0.0;
public double betaParkingCost = 0.0;
public double betaAccessEgressTime = 0.0;
public double betaAlwaysAvailable = 0.0;
......@@ -123,9 +122,9 @@ public class SwissUtilityParameters {
public double lambdaTravelTimeDistance = 0.0;
public double lambdaCostDistance = 0.0;
public double constantAccessEgressWalkTime_min = 0.0;
public double constantParkingSearchPenalty = 0.0;
public double constantParkingSearchPenalty_min = 0.0;
}
public CarParameters car = new CarParameters();
......@@ -162,6 +161,19 @@ public class SwissUtilityParameters {
public PtParameters pt = new PtParameters();
// VI) Private AV
public class PrivateAVParameters {
public double alpha = 0.0;
public double betaTravelTimeLevel3 = 0.0;
public double betaTravelTimeLevel4 = 0.0;
public double betaTravelTimeLevel5 = 0.0;
public double constantAccessEgressWalkTime_min = 0.0;
}
public PrivateAVParameters prav = new PrivateAVParameters();
/**
* Chapter 3.2.1: Modell with linear utility function WITHOUT sociodemographics
*/
......
......@@ -17,9 +17,10 @@ import ch.ethz.matsim.baseline_scenario.transit.routing.EnrichedTransitRoute;
import ch.ethz.matsim.discrete_mode_choice.components.estimators.AbstractTripRouterEstimator;
import ch.ethz.matsim.discrete_mode_choice.model.DiscreteModeChoiceTrip;
import ch.ethz.matsim.discrete_mode_choice.model.trip_based.candidates.TripCandidate;
import ch.ethz.matsim.projects.astra_2018_002.av.ASTRAAVModule;
import ch.ethz.matsim.projects.astra_2018_002.av.routing.ExtendedAVRoute;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.base.TripVariablesPrivateAv.AutomationLevel;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.cost.CostModel;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.SharedAVModule;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.routing.ExtendedAVRoute;
/**
* Estimates trip utilities based on
......@@ -83,27 +84,28 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator {
return estimateWalkTrip(personVariables, trip, routedTrip);
case TransportMode.bike:
return estimateBikeTrip(personVariables, trip, routedTrip);
case TransportMode.car:
case "prav3":
case "prav4":
case "prav5":
return estimatePrivateVehicleTrip(personVariables, trip, routedTrip, mode);
return estimatePrivateAVTrip(personVariables, trip, routedTrip);
case TransportMode.car:
return estimateCarTrip(personVariables, trip, routedTrip);
case TransportMode.pt:
return estimatePtTrip(personVariables, trip, routedTrip);
case ASTRAAVModule.AV_POOL:
case ASTRAAVModule.AV_TAXI:
return estimateAvTrip(personVariables, trip, routedTrip);
case SharedAVModule.AV_POOL:
case SharedAVModule.AV_TAXI:
return estimateSharedAvTrip(personVariables, trip, routedTrip);
default:
throw new IllegalStateException("Unknown mode: " + mode);
}
}
abstract protected double estimateAvTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesAv tripVariables);
abstract protected double estimateSharedAvTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesSharedAv tripVariables);
private double estimateAvTrip(PersonVariables personVariables, DiscreteModeChoiceTrip trip,
private double estimateSharedAvTrip(PersonVariables personVariables, DiscreteModeChoiceTrip trip,
List<? extends PlanElement> elements) {
TripVariablesAv tripVariables = new TripVariablesAv();
TripVariablesSharedAv tripVariables = new TripVariablesSharedAv();
double travelDistance_km = 0.0;
double totalTravelTime = 0.0;
......@@ -119,8 +121,8 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator {
tripVariables.accessEgressTime_min += leg.getTravelTime() / 60.0;
travelDistance_km += leg.getRoute().getDistance() / 1000.0;
break;
case ASTRAAVModule.AV_POOL:
case ASTRAAVModule.AV_TAXI:
case SharedAVModule.AV_POOL:
case SharedAVModule.AV_TAXI:
ExtendedAVRoute route = (ExtendedAVRoute) leg.getRoute();
tripVariables.inVehicleTime_min += route.getTravelTime() / 60.0;
tripVariables.waitingTime_min += route.getWaitingTime() / 60.0;
......@@ -137,7 +139,7 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator {
tripVariables.delay_min = calculateDelay(trip, totalTravelTime) / 60.0;
tripVariables.travelDistance_km = travelDistance_km;
return estimateAvTrip(trip, personVariables, tripVariables);
return estimateSharedAvTrip(trip, personVariables, tripVariables);
}
abstract protected double estimatePtTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
......@@ -235,11 +237,44 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator {
return estimatePtTrip(trip, personVariables, tripVariables);
}
abstract protected double estimatePrivateVehicleTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesCar tripVariables, String mode);
abstract protected double estimatePrivateAVTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesPrivateAv tripVariables);
private double estimatePrivateAVTrip(PersonVariables personVariables, DiscreteModeChoiceTrip trip,
List<? extends PlanElement> elements) {
TripVariablesPrivateAv tripVariables = new TripVariablesPrivateAv();
Leg leg = (Leg) elements.get(0);
double travelDistance_km = leg.getRoute().getDistance() / 1000.0;
tripVariables.travelTime_min = leg.getTravelTime() / 60.0;
tripVariables.travelCost_CHF = costModel.calculateCarTravelCost(travelDistance_km);
tripVariables.crowflyDistance_km = CoordUtils.calcEuclideanDistance(trip.getOriginActivity().getCoord(),
trip.getDestinationActivity().getCoord());
switch (((Leg) elements.get(0)).getMode()) {
case "prav3":
tripVariables.automationLevel = AutomationLevel.LEVEL3;
break;
case "prav4":
tripVariables.automationLevel = AutomationLevel.LEVEL4;
break;
case "prav5":
tripVariables.automationLevel = AutomationLevel.LEVEL5;
break;
default:
new IllegalStateException("Unknown private AV mode given.");
}
return estimatePrivateAVTrip(trip, personVariables, tripVariables);
}
abstract protected double estimateCarTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesCar tripVariables);
private double estimatePrivateVehicleTrip(PersonVariables personVariables, DiscreteModeChoiceTrip trip,
List<? extends PlanElement> elements, String mode) {
private double estimateCarTrip(PersonVariables personVariables, DiscreteModeChoiceTrip trip,
List<? extends PlanElement> elements) {
TripVariablesCar tripVariables = new TripVariablesCar();
Leg leg = (Leg) elements.get(0);
......@@ -249,8 +284,8 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator {
tripVariables.travelCost_CHF = costModel.calculateCarTravelCost(travelDistance_km);
/*
* TODO: Right now we don't define parking cost or parking search time
* TODO: Add different costs for private AVs here.
* TODO: Right now we don't define parking cost or parking search time TODO: Add
* different costs for private AVs here.
*/
tripVariables.parkingSearchTime_min = 0.0;
......@@ -262,7 +297,7 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator {
tripVariables.crowflyDistance_km = CoordUtils.calcEuclideanDistance(trip.getOriginActivity().getCoord(),
trip.getDestinationActivity().getCoord());
return estimatePrivateVehicleTrip(trip, personVariables, tripVariables, mode);
return estimateCarTrip(trip, personVariables, tripVariables);
}
abstract protected double estimateWalkTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
......
package ch.ethz.matsim.projects.astra_2018_002.mode_choice.base;
public class TripVariablesPrivateAv {
public enum AutomationLevel {
LEVEL3, LEVEL4, LEVEL5
}
public AutomationLevel automationLevel;
public double travelTime_min = 0.0;
public double travelCost_CHF = 0.0;
public double travelDistance_km = 0.0;
public double crowflyDistance_km = 0.0;
}
package ch.ethz.matsim.projects.astra_2018_002.mode_choice.base;
public class TripVariablesAv {
public class TripVariablesSharedAv {
public double inVehicleTime_min = 0.0;
public double travelCost_CHF = 0.0;
......
......@@ -54,7 +54,7 @@ public class TestUtility {
double ptUtility = estimator.estimatePtTrip(trip, personVariables, tripVariablesPt);
TripVariablesCar tripVariablesCar = new TripVariablesCar();
double carUtility = estimator.estimatePrivateVehicleTrip(trip, personVariables, tripVariablesCar, "car");
double carUtility = estimator.estimateCarTrip(trip, personVariables, tripVariablesCar);
System.out.println("Walk utility: " + walkUtility);
System.out.println("Bike utility: " + bikeUtility);
......
package ch.ethz.matsim.projects.astra_2018_002.av;
package ch.ethz.matsim.projects.astra_2018_002.private_av;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
......
package ch.ethz.matsim.projects.astra_2018_002.private_av;
import org.matsim.core.config.ReflectiveConfigGroup;
public class PrivateAVConfigGroup extends ReflectiveConfigGroup {
public final static String GROUP_NAME = "private_avs";
private final static String USE_PRIVATE_AVS = "usePrivateAVs";
private boolean usePrivateAVs = false;
public PrivateAVConfigGroup() {
super(GROUP_NAME);
}
@StringGetter(USE_PRIVATE_AVS)
public boolean getUsePrivateAVs() {
return usePrivateAVs;
}
@StringSetter(USE_PRIVATE_AVS)
public void setUsePrivateAVs(boolean usePrivateAVs) {
this.usePrivateAVs = usePrivateAVs;
}
}
package ch.ethz.matsim.projects.astra_2018_002.private_av;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.core.config.Config;
import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ModeParams;
import org.matsim.vehicles.VehicleType;