Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Population::printPopulation() {
- for (int i = 0; i < numberOfPopulation; i++) {
- cout<<population[i]->printTree()<<" wynik: "<<population[i]->getAdaptation()<<endl;
- }
- }
- void Population::findBest() {
- for (int i = 0; i < numberOfPopulation; i++) {
- if (((population[i]->getAdaptation()) < bestResult) && population[i]->isXAndY()) {
- bestResult = population[i]->getAdaptation();
- delete bestTree;
- bestTree = new Tree(*population[i]);
- }
- }
- if (bestTree != NULL) {
- cout << "Najlepsza funkcja: " << bestTree->printTree() << " wynik = " << bestTree->getAdaptation() << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment