Commit 0b9c791e authored by Sebastian Hörl's avatar Sebastian Hörl
Browse files

Improve outside constraint

parent 51189a20
......@@ -12,6 +12,7 @@ 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.discrete_mode_choice.modules.DiscreteModeChoiceModule;
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;
......@@ -62,6 +63,7 @@ public class RunASTRA2018002 {
UtilitySet utilitySet = Enum.valueOf(UtilitySet.class, cmd.getOption("model").orElse("ZERO"));
boolean useRouteChoice = cmd.getOption("use-route-choice").map(Boolean::parseBoolean).orElse(true);
boolean useOnlySignificant = cmd.getOption("use-only-significant").map(Boolean::parseBoolean).orElse(false);
controller.addOverridingModule(new DiscreteModeChoiceModule());
controller.addOverridingModule(
new SwissDiscreteModeChoiceModule(utilitySet, useRouteChoice, useOnlySignificant, cmd));
......
......@@ -10,17 +10,19 @@ import org.matsim.pt.transitSchedule.api.TransitSchedule;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import com.google.inject.name.Named;
import ch.ethz.matsim.baseline_scenario.config.CommandLine;
import ch.ethz.matsim.baseline_scenario.config.CommandLine.ConfigurationException;
import ch.ethz.matsim.discrete_mode_choice.components.utils.home_finder.HomeFinder;
import ch.ethz.matsim.discrete_mode_choice.modules.AbstractDiscreteModeChoiceExtension;
import ch.ethz.matsim.discrete_mode_choice.modules.DiscreteModeChoiceModule;
import ch.ethz.matsim.discrete_mode_choice.modules.config.DiscreteModeChoiceConfigGroup;
import ch.ethz.matsim.discrete_mode_choice.modules.config.ModeAvailabilityConfigGroup;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.SwissUtilityParameters.UtilitySet;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.cost.CostModel;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.cost.CostParameters;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.outside.OutsideConstraint;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.outside.SwissHomeFinder;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.outside.SwissTourFinder;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.pricing.DefaultSharedAVTravelCost;
import ch.ethz.matsim.projects.astra_2018_002.shared_av.pricing.SharedAVTravelCost;
......@@ -48,7 +50,6 @@ public class SwissDiscreteModeChoiceModule extends AbstractDiscreteModeChoiceExt
@Override
protected void installExtension() {
install(new DiscreteModeChoiceModule());
bindTripEstimator(SWISS_ESTIMATOR_NAME).to(SwissUtilityEstimator.class);
bindModeAvailability(SWISS_MODE_AVAILABILITY_NAME).to(SwissModeAvailability.class);
bindTourFinder(SWISS_TOUR_FINDER_NAME).to(SwissTourFinder.class);
......@@ -114,4 +115,11 @@ public class SwissDiscreteModeChoiceModule extends AbstractDiscreteModeChoiceExt
public OutsideConstraint.Factory provideOutsideConstraintFactory() {
return new OutsideConstraint.Factory();
}
@Provides
@Singleton
@Named("tour")
public HomeFinder provideHomeFinder() {
return new SwissHomeFinder();
}
}
package ch.ethz.matsim.projects.astra_2018_002.mode_choice.outside;
import java.util.List;
import org.matsim.api.core.v01.BasicLocation;
import org.matsim.api.core.v01.Id;
import ch.ethz.matsim.discrete_mode_choice.components.utils.home_finder.HomeFinder;
import ch.ethz.matsim.discrete_mode_choice.model.DiscreteModeChoiceTrip;
public class SwissHomeFinder implements HomeFinder {
@Override
public Id<? extends BasicLocation> getHomeLocationId(List<DiscreteModeChoiceTrip> trips) {
return null;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment