23 package org.matsim.core.replanning.selectors;
29 import java.util.concurrent.ConcurrentHashMap;
50 Map<String, Integer> typeCounts =
new ConcurrentHashMap<String, Integer>();
54 String type = plan.getType();
56 type = UNDEFINED_PLAN_TYPE;
58 typeCounts.merge( type, 1, ( a, b ) -> a + b );
62 double worstScore = Double.POSITIVE_INFINITY;
65 String type = plan.getType();
67 type = UNDEFINED_PLAN_TYPE;
69 if ( typeCounts.get( type ) > 1) {
73 if (plan.getScore() == null || plan.getScore().isNaN() ) {
78 worstScore = Double.NEGATIVE_INFINITY;
81 }
else if (plan.getScore() < worstScore) {
83 worstScore = plan.getScore();
94 if (plan.getScore() == null || plan.getScore().isNaN() ) {
97 if (plan.getScore() < worstScore) {
99 worstScore = plan.getScore();
String UNDEFINED_PLAN_TYPE
T selectPlan(HasPlansAndId< T, I > person)
abstract List<? extends T > getPlans()