本文整理汇总了C++中GAGenome::clone方法的典型用法代码示例。如果您正苦于以下问题:C++ GAGenome::clone方法的具体用法?C++ GAGenome::clone怎么用?C++ GAGenome::clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GAGenome
的用法示例。
在下文中一共展示了GAGenome::clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
GAPopulation::GAPopulation(const GAGenome & c, unsigned int popsize) {
csz = N = GA_POP_CHUNKSIZE;
n = (popsize < 1 ? 1 : popsize);
while(N < n) N += csz;
rind = new GAGenome * [N];
sind = new GAGenome * [N];
for(unsigned int i=0; i<n; i++)
rind[i] = c.clone(GAGenome::ATTRIBUTES);
memcpy(sind, rind, N * sizeof(GAGenome*));
// indDiv = new float[N*N];
indDiv = 0;
neval = 0;
rawSum = rawAve = rawDev = rawVar = rawMax = rawMin = 0.0;
fitSum = fitAve = fitDev = fitVar = fitMax = fitMin = 0.0;
popDiv = -1.0;
rsorted = ssorted = evaluated = gaFalse;
scaled = statted = divved = selectready = gaFalse;
sortorder = HIGH_IS_BEST;
init = DefaultInitializer;
eval = DefaultEvaluator;
slct = new DEFAULT_SELECTOR;
slct->assign(*this);
sclscm = new DEFAULT_SCALING;
evaldata = nullptr;
ga = nullptr;
}