/** * Randomly chooses for each person of the population a strategy and uses that * strategy on the person, after adapting the strategies to any pending change * requests for the specified iteration. * * @param iteration the current iteration we're handling */ public final void run( final Iterable<? extends HasPlansAndId<PL, AG>> persons, ObjectAttributes subpopLookup, final int iteration, final ReplanningContext replanningContext ) { handleChangeRequests(iteration); run(persons, subpopLookup, replanningContext); }
@Override public void notifyReplanning(final ReplanningEvent event) { if (carrierPlanStrategyManagerFactory == null) { return; } GenericStrategyManager<CarrierPlan, Carrier> strategyManager = carrierPlanStrategyManagerFactory.createStrategyManager(); Collection<HasPlansAndId<CarrierPlan, Carrier>> collection = new ArrayList<>(); for (Carrier carrier : carriers.getCarriers().values()) { collection.add(carrier); } strategyManager.run(collection, null, event.getIteration(), event.getReplanningContext()); }
/** * Randomly chooses for each person of the population a strategy and uses that * strategy on the person. * */ public final void run(final Population population, final ReplanningContext replanningContext) { beforePopulationRunHook(population, replanningContext); delegate.run(population.getPersons().values(), population.getPersonAttributes(), replanningContext); afterRunHook(population); }