示例#1
0
void PerPointUpdater<TFunction>::update(Population* population) {
  for (Population::Iterator it = population->begin();
       it != population->end();
       ++it) {
     Point updated_point;
     (one_point_updaters_info_->getInfoById(it.point_id()))->update(it.point(),
                                                         &updated_point);
     population->updatePoint(it.point_id(), updated_point);
  }
}
void PerPointStopCriterion<TFunction>::update(const Population& population) {
  for (Population::Iterator it = population.begin();
       it != population.end();
       ++it) {
    typename OnePointStopCriterion<TFunction>::Ptr one_point_stop_criterion =
      stop_criterion_info_->getInfoById(it.point_id());
    one_point_stop_criterion->update(it.point());
  }
}
示例#3
0
PopulationInfo<TInfo>::PopulationInfo(Population* population,
                                      typename TInfo::Ptr sample_info)
    : BasePopulationInfo(population),
      sample_info_(sample_info) {
  for (Population::Iterator individual = population->begin();
       individual != population->end();
       ++individual) {
    typename TInfo::Ptr info = sample_info_->clone();
    info->init(individual.point(),
               sample_info_->function(),
               sample_info_->set());
    infomap_[individual.point_id()] = info;
  }
}