/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. *
*/
// Initialize population with individuals that have been initialized with uniform random // noise // uniform noise means random value inside your search space
maPopulation.reserve(mnPopulationSize); for (size_t i = 0; i < mnPopulationSize; ++i)
{
maPopulation.emplace_back();
Individual& rIndividual = maPopulation.back();
mrDataProvider.initializeVariables(rIndividual.mVariables, maGenerator);
}
}
// see if is better than original, if so replace if (fCandidateFitness > mrDataProvider.calculateFitness(rOriginal.mVariables))
{
maPopulation[x] = std::move(aCandidate);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.