Changeset 1130 for cpp/frams/_demos/evol_test.cpp
- Timestamp:
- 04/16/21 15:55:34 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/evol_test.cpp
r1031 r1130 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 2019-202 0Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 2019-2021 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 195 195 for (int i = 0; i < nr_evals; i++) 196 196 { 197 int selected_positive = tournament(population, max(2, int(sqrt(population.size()) / 2))); //moderate positive selection pressure197 int selected_positive = tournament(population, std::max(2, int(sqrt(population.size()) / 2))); //moderate positive selection pressure 198 198 int selected_negative = rndUint(population.size()); //random negative selection 199 199 … … 214 214 else 215 215 { 216 int selected_positive2 = tournament(population, max(2, int(sqrt(population.size()) / 2)));216 int selected_positive2 = tournament(population, std::max(2, int(sqrt(population.size()) / 2))); 217 217 Geno xover = genman.crossOver(population[selected_positive].geno, population[selected_positive2].geno); 218 218 if (xover.getGenes() == "")
Note: See TracChangeset
for help on using the changeset viewer.