Commit 3e401f0b authored by Sebastian Hörl's avatar Sebastian Hörl
Browse files

Some code cleanup regarding private AVs

parent f62f383d
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,7 +8,7 @@ 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.TripVariablesSharedAv;
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.TripVariablesPt;
......@@ -204,7 +204,7 @@ public class SwissUtilityEstimator extends BaseUtilityEstimator {
@Override
public double estimateAvTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesAv tripVariables) {
TripVariablesSharedAv tripVariables) {
double utility = 0.0;
// TODO: Right now we use utilties from car and waiting is not scored!
......
......@@ -17,9 +17,9 @@ 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.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
......@@ -90,8 +90,8 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator {
return estimatePrivateVehicleTrip(personVariables, trip, routedTrip, mode);
case TransportMode.pt:
return estimatePtTrip(personVariables, trip, routedTrip);
case ASTRAAVModule.AV_POOL:
case ASTRAAVModule.AV_TAXI:
case SharedAVModule.AV_POOL:
case SharedAVModule.AV_TAXI:
return estimateAvTrip(personVariables, trip, routedTrip);
default:
throw new IllegalStateException("Unknown mode: " + mode);
......@@ -99,11 +99,11 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator {
}
abstract protected double estimateAvTrip(DiscreteModeChoiceTrip trip, PersonVariables personVariables,
TripVariablesAv tripVariables);
TripVariablesSharedAv tripVariables);
private double estimateAvTrip(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 +119,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;
......
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;
......
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;
import ch.ethz.matsim.discrete_mode_choice.modules.config.DiscreteModeChoiceConfigGroup;
public class PrivateAVConfigurator {
static final public Id<VehicleType> PRAV3_ID = Id.create("prav3", VehicleType.class);
static final public Id<VehicleType> PRAV4_ID = Id.create("prav4", VehicleType.class);
static final public Id<VehicleType> PRAV5_ID = Id.create("prav5", VehicleType.class);
static final public String PRAV_3 = "prav3";
static final public String PRAV_4 = "prav4";
static final public String PRAV_5 = "prav5";
static final public Collection<String> PRAV_MODES = Arrays.asList(PRAV_3, PRAV_4, PRAV_5);
static public void configure(Config config) {
PrivateAVConfigGroup privateConfig = (PrivateAVConfigGroup) config.getModules()
.get(PrivateAVConfigGroup.GROUP_NAME);
if (privateConfig == null) {
privateConfig = new PrivateAVConfigGroup();
config.addModule(privateConfig);
}
if (privateConfig.getUsePrivateAVs()) {
DiscreteModeChoiceConfigGroup dmcConfig = (DiscreteModeChoiceConfigGroup) config.getModules()
.get(DiscreteModeChoiceConfigGroup.GROUP_NAME);
Set<String> cachedModes = new HashSet<>(dmcConfig.getCachedModes());
cachedModes.addAll(PRAV_MODES);
dmcConfig.setCachedModes(cachedModes);
Set<String> restrictedModes = new HashSet<>(
dmcConfig.getVehicleTourConstraintConfig().getRestrictedModes());
restrictedModes.addAll(PRAV_MODES);
dmcConfig.getVehicleTourConstraintConfig().setRestrictedModes(restrictedModes);
Set<String> networkAndMainModes = new HashSet<>(Collections.singleton(TransportMode.car));
networkAndMainModes.addAll(PRAV_MODES);
config.plansCalcRoute().setNetworkModes(networkAndMainModes);
config.qsim().setMainModes(networkAndMainModes);
config.travelTimeCalculator().setAnalyzedModes(String.join(",", networkAndMainModes));
config.travelTimeCalculator().setSeparateModes(false);
for (String mode : PRAV_MODES) {
ModeParams params = new ModeParams(mode);
config.planCalcScore().addModeParams(params);
}
}
}
static public void assignPrivateAVs(Scenario scenario) {
PrivateAVConfigGroup privateConfig = (PrivateAVConfigGroup) scenario.getConfig().getModules()
.get(PrivateAVConfigGroup.GROUP_NAME);
if (privateConfig.getUsePrivateAVs()) {
AssignPrivatAVs.main(scenario);
}
}
}
package ch.ethz.matsim.projects.astra_2018_002.av;
package ch.ethz.matsim.projects.astra_2018_002.shared_av;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.network.NetworkWriter;
......
package ch.ethz.matsim.projects.astra_2018_002;
package ch.ethz.matsim.projects.astra_2018_002.shared_av;
import org.matsim.core.config.ReflectiveConfigGroup;
public class ASTRAConfigGroup extends ReflectiveConfigGroup {
public final static String GROUP_NAME = "astra";
public class SharedAVConfigGroup extends ReflectiveConfigGroup {
public final static String GROUP_NAME = "shared_avs";
private final static String ENABLE_AVS = "enableAvs";
private final static String USE_SHARED_AVS = "useSharedAVs";
private final static String TAXI_FLEET_SIZE = "taxiFleetSize";
private final static String POOLED_FLEET_SIZE = "pooledFleetSize";
private final static String SERVICE_AREA_ATTRIBUTE = "serviceAreaAttribute";
......@@ -14,7 +14,7 @@ public class ASTRAConfigGroup extends ReflectiveConfigGroup {
private final static String WAITING_TIME_ZONE_SHAPEFILE = "waitingTimeZoneShapefile";
private final static String WAITING_TIME_ZONE_IDENTIFIER_ATTRIBUTE = "waitingTimeZoneIdentifierAttribute";
private boolean enableAVs = false;
private boolean useSharedAVs = false;
private int taxiFleetSize = 100;
private int pooledFleetSize = 0;
......@@ -26,18 +26,18 @@ public class ASTRAConfigGroup extends ReflectiveConfigGroup {
private String waitingTimeZoneIdentifierAttribute = "WZONE";
private String waitingTimeZoneShapefile = "waiting_time_areas.shp";
public ASTRAConfigGroup() {
public SharedAVConfigGroup() {
super(GROUP_NAME);
}
@StringGetter(ENABLE_AVS)
public boolean getEnableAVs() {
return enableAVs;
@StringGetter(USE_SHARED_AVS)
public boolean getUseSharedAVs() {
return useSharedAVs;
}
@StringSetter(ENABLE_AVS)
public void setEnableAVs(boolean enableAVs) {
this.enableAVs = enableAVs;
@StringSetter(USE_SHARED_AVS)
public void setUseSharedAVs(boolean useSharedAVs) {
this.useSharedAVs = useSharedAVs;
}
@StringGetter(TAXI_FLEET_SIZE)
......
package ch.ethz.matsim.projects.astra_2018_002.av;
package ch.ethz.matsim.projects.astra_2018_002.shared_av;
import java.util.Collection;
import java.util.HashSet;
......@@ -13,10 +13,9 @@ import org.matsim.core.controler.Controler;
import ch.ethz.matsim.av.framework.AVConfigGroup;
import ch.ethz.matsim.av.framework.AVModule;
import ch.ethz.matsim.discrete_mode_choice.modules.config.DiscreteModeChoiceConfigGroup;
import ch.ethz.matsim.projects.astra_2018_002.ASTRAConfigGroup;
import ch.ethz.matsim.projects.astra_2018_002.ASTRAQSimModule;
public class AVConfigurator {
public class SharedAVConfigurator {
static public void configure(Config config) {
DvrpConfigGroup dvrpConfig = (DvrpConfigGroup) config.getModules().get(DvrpConfigGroup.GROUP_NAME);
......@@ -33,21 +32,22 @@ public class AVConfigurator {
avConfig.setParallelRouters(config.global().getNumberOfThreads());
}
ASTRAConfigGroup astraConfig = (ASTRAConfigGroup) config.getModules().get(ASTRAConfigGroup.GROUP_NAME);
SharedAVConfigGroup sharedConfig = (SharedAVConfigGroup) config.getModules()
.get(SharedAVConfigGroup.GROUP_NAME);
if (astraConfig == null) {
astraConfig = new ASTRAConfigGroup();
config.addModule(astraConfig);
if (sharedConfig == null) {
sharedConfig = new SharedAVConfigGroup();
config.addModule(sharedConfig);
}
if (astraConfig.getEnableAVs()) {
if (sharedConfig.getUseSharedAVs()) {
ModeParams avParams = new ModeParams(AVModule.AV_MODE);
config.planCalcScore().addModeParams(avParams);
ModeParams poolParams = new ModeParams(ASTRAAVModule.AV_POOL);
ModeParams poolParams = new ModeParams(SharedAVModule.AV_POOL);
config.planCalcScore().addModeParams(poolParams);
ModeParams taxiParams = new ModeParams(ASTRAAVModule.AV_TAXI);
ModeParams taxiParams = new ModeParams(SharedAVModule.AV_TAXI);
config.planCalcScore().addModeParams(taxiParams);
DiscreteModeChoiceConfigGroup dmcConfig = (DiscreteModeChoiceConfigGroup) config.getModules()
......@@ -55,16 +55,16 @@ public class AVConfigurator {
Set<String> availableModes = new HashSet<>(dmcConfig.getCarModeAvailabilityConfig().getAvailableModes());
if (astraConfig.getTaxiFleetSize() > 0) {
availableModes.add(ASTRAAVModule.AV_TAXI);
if (sharedConfig.getTaxiFleetSize() > 0) {
availableModes.add(SharedAVModule.AV_TAXI);
}
if (astraConfig.getPooledFleetSize() > 0) {
availableModes.add(ASTRAAVModule.AV_POOL);
if (sharedConfig.getPooledFleetSize() > 0) {
availableModes.add(SharedAVModule.AV_POOL);
}
Collection<String> tripConstraints = new HashSet<>(dmcConfig.getTripConstraints());
tripConstraints.add(ASTRAAVModule.CONSTRAINT_NAME);
tripConstraints.add(SharedAVModule.CONSTRAINT_NAME);
dmcConfig.setTripConstraints(tripConstraints);
dmcConfig.getCarModeAvailabilityConfig().setAvailableModes(availableModes);
......@@ -72,13 +72,13 @@ public class AVConfigurator {
}
static public void configureController(Controler controller) {
ASTRAConfigGroup astraConfig = (ASTRAConfigGroup) controller.getConfig().getModules()
.get(ASTRAConfigGroup.GROUP_NAME);
SharedAVConfigGroup sharedConfig = (SharedAVConfigGroup) controller.getConfig().getModules()
.get(SharedAVConfigGroup.GROUP_NAME);
if (astraConfig.getEnableAVs()) {
if (sharedConfig.getUseSharedAVs()) {
controller.addOverridingModule(new DvrpTravelTimeModule());
controller.addOverridingModule(new AVModule());
controller.addOverridingModule(new ASTRAAVModule());
controller.addOverridingModule(new SharedAVModule());
controller.addOverridingModule(new ASTRAQSimModule());
}
}
......
package ch.ethz.matsim.projects.astra_2018_002.av;
package ch.ethz.matsim.projects.astra_2018_002.shared_av;
import java.net.URL;
import java.util.List;
......@@ -27,19 +27,18 @@ import ch.ethz.matsim.av.framework.AVModule;
import ch.ethz.matsim.av.framework.AVUtils;
import ch.ethz.matsim.av.routing.AVRouteFactory;
import ch.ethz.matsim.discrete_mode_choice.modules.AbstractDiscreteModeChoiceExtension;
import ch.ethz.matsim.projects.astra_2018_002.ASTRAConfigGroup;
import ch.ethz.matsim.projects.astra_2018_002.av.analysis.WaitingTimeListener;
import ch.ethz.matsim.projects.astra_2018_002.av.routing.ASTRAAVRoutingModule;
import ch.ethz.matsim.projects.astra_2018_002.av.service_area.ServiceArea;
import ch.ethz.matsim.projects.astra_2018_002.av.service_area.ServiceAreaConstraint;
import ch.ethz.matsim.projects.astra_2018_002.av.service_area.ServiceAreaGenerator;
import ch.ethz.matsim.projects.astra_2018_002.av.service_area.ServiceAreaReader;
import ch.ethz.matsim.projects.astra_2018_002.av.waiting_time.AVWaitingTime;
import ch.ethz.matsim.projects.astra_2018_002.av.waiting_time.zonal.WaitingTimeZone;
import ch.ethz.matsim.projects.astra_2018_002.av.waiting_time.zonal.WaitingTimeZoneReader;
import ch.ethz.matsim.projects.astra_2018_002.av.waiting_time.zonal.ZonalWaitingTime;
public class ASTRAAVModule extends AbstractDiscreteModeChoiceExtension {
import ch.ethz.matsim.projects.astra_2018_002.shared_av.analysis.WaitingTimeListener;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.routing.ASTRAAVRoutingModule;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.service_area.ServiceArea;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.service_area.ServiceAreaConstraint;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.service_area.ServiceAreaGenerator;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.service_area.ServiceAreaReader;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.waiting_time.AVWaitingTime;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.waiting_time.zonal.WaitingTimeZone;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.waiting_time.zonal.WaitingTimeZoneReader;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.waiting_time.zonal.ZonalWaitingTime;
public class SharedAVModule extends AbstractDiscreteModeChoiceExtension {
public static final String CONSTRAINT_NAME = "ASTRA";
public static final String GENERATOR_NAME = "ASTRA";
......@@ -103,7 +102,7 @@ public class ASTRAAVModule extends AbstractDiscreteModeChoiceExtension {
@Provides
@Singleton
public ServiceArea provideServiceArea(@Named(AVModule.AV_MODE) Network network, ASTRAConfigGroup astraConfig) {
public ServiceArea provideServiceArea(@Named(AVModule.AV_MODE) Network network, SharedAVConfigGroup astraConfig) {
ServiceAreaReader reader = new ServiceAreaReader(astraConfig.getServiceAreaAttribute(), network);