Class ChooseRandomLegModeForSubtour
- java.lang.Object
-
- org.matsim.core.population.algorithms.ChooseRandomLegModeForSubtour
-
- All Implemented Interfaces:
PlanAlgorithm
public final class ChooseRandomLegModeForSubtour extends Object implements PlanAlgorithm
Changes the transportation mode of one random non-empty subtour in a plan to a randomly chosen different mode given a list of possible modes, considering that the means of transport follows the law of mass conservation.- Author:
- michaz
- See Also:
SubtourModeChoice
-
-
Constructor Summary
Constructors Constructor Description ChooseRandomLegModeForSubtour(MainModeIdentifier mainModeIdentifier, PermissibleModesCalculator permissibleModesCalculator, String[] modes, String[] chainBasedModes, Random rng, SubtourModeChoice.Behavior behavior, double probaForChooseRandomSingleTripMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run(Plan plan)
void
setSingleTripSubtourModes(String[] singleTripSubtourModes)
Some subtour consist of only a single trip, e.g.
-
-
-
Constructor Detail
-
ChooseRandomLegModeForSubtour
public ChooseRandomLegModeForSubtour(MainModeIdentifier mainModeIdentifier, PermissibleModesCalculator permissibleModesCalculator, String[] modes, String[] chainBasedModes, Random rng, SubtourModeChoice.Behavior behavior, double probaForChooseRandomSingleTripMode)
-
-
Method Detail
-
setSingleTripSubtourModes
public void setSingleTripSubtourModes(String[] singleTripSubtourModes)
Some subtour consist of only a single trip, e.g. if a trip starts and ends on the same link or facility. By default, for those modes, the normal chain based modes are available. But in certain cases, not all the modes should be available for such trips (e.g. car-sharing does not make much sense for such a trip), thus the list of modes available for single-trip subtours can be specified independently. As mentioned, it is initialized by the constructor to the full list of chain based modes.- Parameters:
singleTripSubtourModes
-
-
run
public void run(Plan plan)
- Specified by:
run
in interfacePlanAlgorithm
-
-