Class DiversityGeneratingPlansRemoverANIK

  • All Implemented Interfaces:
    org.matsim.core.replanning.selectors.PlanSelector<org.matsim.api.core.v01.population.Plan,​org.matsim.api.core.v01.population.Person>

    public final class DiversityGeneratingPlansRemoverANIK
    extends org.matsim.core.replanning.selectors.AbstractPlanSelector
    This class aims to increase the diversity of plans in an agent's choice set. This is achieved by removing a plan once it is found to be similar to another plan of the choice set. If no plan is considered similar to another plan the standard MATSim behavior is preserved, i.e. as of May 2014 the worst scored plan will be removed from the choice set. As first tests indicate, this effectively prevents agents from over-adapting, i.e. arriving at a stop only seconds before the bus departs.

    Details:
    A plan is considered similar to another plan if all of the similarity checkers consider the plan similar. For example, two plans with the same activity end times are similar if they also use the same mode of transport. If one of the similarity checkers fails, the plans are considered dissimilar. Note that currently only activity end times are checked for. See DiversityGeneratingPlansRemoverANIK#similarity(Plan, Plan, StageActivityTypes, double) for information on adding further similarity checkers. From two plans considered as similar the older one is preserved and the newer one will be deleted. The comparison stops at this point and further plans are not checked for. Note that this class can only delete one plan at a time. Multiple iterations are required in case more than two plans would be considered as similar. Note that the similarity checks depend on the plans of the choice set and may thus yield different results once a plan is removed. Further note that the order in which plans are compared to each other depends on the List implementation in which the plans are stored. As of May 2014 this is an ArrayList (Person#plans).

    Author:
    aneumann, ikaddoura
    • Method Detail

      • calcWeights

        protected Map<org.matsim.api.core.v01.population.Plan,​DoublecalcWeights​(List<? extends org.matsim.api.core.v01.population.Plan> plans)
        Specified by:
        calcWeights in class org.matsim.core.replanning.selectors.AbstractPlanSelector
        Returns:
        Map giving a weight for each plan. Higher weights have a higher probability of being selected.