本文整理汇总了C++中archipelago类的典型用法代码示例。如果您正苦于以下问题:C++ archipelago类的具体用法?C++ archipelago怎么用?C++ archipelago使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了archipelago类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: std_dev
double std_dev(archipelago a, double mean) {
double retval = 0;
for (archipelago::size_type i = 0; i< a.get_size(); ++i) {
retval += pow((a.get_island(i)->get_population().champion().f[0] - mean),2);
}
return sqrt(retval / a.get_size());
}
开发者ID:DinCahill,项目名称:pagmo,代码行数:7,代码来源:migrate_or_not.cpp
示例2: mean
double mean(archipelago a) {
double retval = 0;
for (archipelago::size_type i = 0; i< a.get_size(); ++i) {
retval += a.get_island(i)->get_population().champion().f[0];
}
return retval / a.get_size();
}
开发者ID:DinCahill,项目名称:pagmo,代码行数:7,代码来源:migrate_or_not.cpp
示例3: std_dev
double std_dev(archipelago a, double mean, problem::base_ptr original_problem) {
double retval = 0;
for (archipelago::size_type i = 0; i< a.get_size(); ++i) {
// test feasibility
if(original_problem->feasibility_x(a.get_island(i)->get_population().champion().x))
retval += pow((a.get_island(i)->get_population().champion().f[0] - mean),2);
}
return sqrt(retval / a.get_size());
}
开发者ID:DominicDirkx,项目名称:pagmo,代码行数:9,代码来源:constraints_handling.cpp
示例4: worst
double worst(archipelago a, problem::base_ptr original_problem) {
double retval = - boost::numeric::bounds<double>::highest();
for (archipelago::size_type i = 0; i< a.get_size(); ++i) {
// test feasibility
if(original_problem->feasibility_x(a.get_island(i)->get_population().champion().x))
retval = std::max(retval, a.get_island(i)->get_population().champion().f[0]);
}
return retval;
}
开发者ID:DominicDirkx,项目名称:pagmo,代码行数:9,代码来源:constraints_handling.cpp
示例5: getSolutions
std::string getSolutions(archipelago a) {
std::ostringstream sol;
int solSize = a.get_island(0)->get_population().champion().x.size();
for (archipelago::size_type i = 0; i< a.get_size(); ++i) {
sol << "island " << i << ": (";
for(int j = 0; j < solSize; ++j) {
sol << a.get_island(i)->get_population().champion().x[j] << ",";
}
sol << ")" << std::endl;
}
return sol.str();
}
开发者ID:DinCahill,项目名称:pagmo,代码行数:12,代码来源:migrate_or_not.cpp
示例6: mean
double mean(archipelago a, problem::base_ptr original_problem) {
double retval = 0;
int count_feasible_arch = 0;
for (archipelago::size_type i = 0; i< a.get_size(); ++i) {
// test feasibility
if(original_problem->feasibility_x(a.get_island(i)->get_population().champion().x)) {
retval += a.get_island(i)->get_population().champion().f[0];
count_feasible_arch++;
}
}
if(count_feasible_arch != 0)
return retval / count_feasible_arch;
else
return 0.;
}
开发者ID:DinCahill,项目名称:pagmo,代码行数:15,代码来源:cstrs_co_evolution.cpp
注:本文中的archipelago类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论