Changeset 1130 for cpp/frams/genetics/fS
- Timestamp:
- 04/16/21 15:55:34 (4 years ago)
- Location:
- cpp/frams/genetics/fS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/fS/fS_general.cpp
r1108 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 … … 13 13 #include "common/nonstd_math.h" 14 14 #include <frams/model/geometry/part_distance_estimator.h> 15 #include <algorithm> 15 16 16 17 int fS_Genotype::precision = 4; -
cpp/frams/genetics/fS/fS_oper.cpp
r1056 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 … … 7 7 #include "fS_oper.h" 8 8 #include "frams/util/rndutil.h" 9 #include <algorithm> 9 10 10 11 #define FIELDSTRUCT GenoOper_fS … … 362 363 { 363 364 // Remove the selected child 364 s wap(randomNode->children[selectedIndex], randomNode->children[childCount - 1]);365 std::swap(randomNode->children[selectedIndex], randomNode->children[childCount - 1]); 365 366 randomNode->children.pop_back(); 366 367 randomNode->children.shrink_to_fit(); … … 586 587 fS_Neuron *it = randomNode->neurons[rndUint(size)]; 587 588 geno.rearrangeNeuronConnections(it, SHIFT::LEFT); // Important to rearrange the neurons before deleting 588 s wap(it, randomNode->neurons.back());589 std::swap(it, randomNode->neurons.back()); 589 590 randomNode->neurons.pop_back(); 590 591 randomNode->neurons.shrink_to_fit();
Note: See TracChangeset
for help on using the changeset viewer.