/** * changes the weight of the specified strategy * * @return true if the strategy is part of this manager and the weight could * be changed successfully, false otherwise. */ public final boolean changeWeightOfStrategy( final GenericPlanStrategy<Plan, Person> strategy, final String subpopulation, final double newWeight) { return delegate.changeWeightOfStrategy(strategy, subpopulation, newWeight) ; }
/** * modifies the loaded strategies according to pending change requests for this iteration. * */ final void handleChangeRequests(final int iteration) { for ( int ii = 0 ; ii <= iteration ; ii++ ) { // (playing back history for those installations which recreate the strategy manager in every iteration) for ( Map.Entry<String, StrategyWeights<PL, AG>> wentry : weightsPerSubpopulation.entrySet() ) { final String subpop = wentry.getKey(); final StrategyWeights<PL, AG> weights = wentry.getValue(); Map<GenericPlanStrategy<PL, AG>, Double> changes = weights.changeRequests.remove(ii); if (changes != null) { for (Map.Entry<GenericPlanStrategy<PL, AG>, Double> entry : changes.entrySet()) { changeWeightOfStrategy( entry.getKey(), subpop, entry.getValue()); } } } } }