本文整理汇总了C++中DataFrame::getInstance方法的典型用法代码示例。如果您正苦于以下问题:C++ DataFrame::getInstance方法的具体用法?C++ DataFrame::getInstance怎么用?C++ DataFrame::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataFrame
的用法示例。
在下文中一共展示了DataFrame::getInstance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: diversifyPopulation
vector<int*> diversifyPopulation(vector<pdi>& costHeap, vector<int*> population, int numKeep, int numNew, DataFrame dataFrame, vector<int>* conflictGraph) {
vector<int*> newPopulation;
double fitness;
int id;
//vector<pdi> costHeapAux;
//make_heap(costHeapAux.begin(), costHeapAux.end(), smallerOp());
for(int i = 0; i < numKeep; i++) {
fitness = costHeap.front().first;
id = costHeap.front().second;
//costHeapAux.push_back(pdi(fitness, i));
//push_heap(costHeapAux.begin(), costHeapAux.end(), smallerOp());
pop_heap(costHeap.begin(), costHeap.end(), smallerOp());
costHeap.pop_back();
newPopulation.push_back(population[id]);
}
vector<int*> randomIndividuals = getPopulation(dataFrame.getInstance(), numNew);
for(int i = 0; i < randomIndividuals.size(); i++) {
KCenterSolver* ind = createSolver(dataFrame, randomIndividuals[i]);
ind->localSearch(conflictGraph);
newPopulation.push_back(ind->getSolution());
//costHeapAux.push_back(pdi(ind->getCost(), numKeep+i));
//push_heap(costHeapAux.begin(), costHeapAux.end(), smallerOp());
delete ind;
}
//vector<pdi>(costHeap).swap(costHeap);
//costHeap = costHeapAux;
return newPopulation;
}