Class AbstractTourConstraint
- java.lang.Object
-
- org.matsim.contribs.discrete_mode_choice.model.constraints.AbstractTourConstraint
-
- All Implemented Interfaces:
TourConstraint
- Direct Known Subclasses:
SubtourModeConstraint
public abstract class AbstractTourConstraint extends Object implements TourConstraint
An abstract TourConstraint that always returns true if the validation methods are not overridden.- Author:
- sebhoerl
-
-
Constructor Summary
Constructors Constructor Description AbstractTourConstraint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
validateAfterEstimation(List<DiscreteModeChoiceTrip> tour, TourCandidate candidate, List<TourCandidate> previousCandidates)
This function is called after a tour is estimated.boolean
validateBeforeEstimation(List<DiscreteModeChoiceTrip> tour, List<String> modes, List<List<String>> previousModes)
This function is called before any estimation of utilities for a tour is happening.
-
-
-
Constructor Detail
-
AbstractTourConstraint
public AbstractTourConstraint()
-
-
Method Detail
-
validateBeforeEstimation
public boolean validateBeforeEstimation(List<DiscreteModeChoiceTrip> tour, List<String> modes, List<List<String>> previousModes)
Description copied from interface:TourConstraint
This function is called before any estimation of utilities for a tour is happening. If it returns true, the given modes are a feasible option (at least before estimating the routing etc.) for the tour. If it returns false, the given modes will not be considered further as an alternative for the tour. Since tour decisions are performed one after another the previousModes argument contains a list of modes that have been chosen for earlier tours in the plan.- Specified by:
validateBeforeEstimation
in interfaceTourConstraint
-
validateAfterEstimation
public boolean validateAfterEstimation(List<DiscreteModeChoiceTrip> tour, TourCandidate candidate, List<TourCandidate> previousCandidates)
Description copied from interface:TourConstraint
This function is called after a tour is estimated. If it returns true, the given modes are a feasible option for the tour, while false indicates that these mode alternatives should not be considered anymore. Since tour decisions are performed one after another the previousCandidates argument contains a list of candidates that have been chosen for earlier tours in the plan.- Specified by:
validateAfterEstimation
in interfaceTourConstraint
-
-