* @param splitPlace Gene number on which the Genes should be swapped
* @return new Chromosome crossed between given two
*/
- _Chromosome do_cross(_Chromosome& first, _Chromosome& second, unsigned int splitPlace) {
+ _Chromosome do_cross(_Chromosome& first, _Chromosome& second, const unsigned int splitPlace) {
const unsigned int chromosomeSize = first.size();
// cout << " ";
*
* @param chance probability of Crossover (0 = 0%, 1 = 100%)
*/
- Crossover(CrossoverChanceType chance) :
+ Crossover(const CrossoverChanceType& chance) :
chance(chance) {
}
*/
Generation<_Chromosome> cross(Generation<_Chromosome>& _generation) {
const unsigned int generationSize = _generation.size();
- vector<_Chromosome> newGeneration;
+ std::vector<_Chromosome> newGeneration;
for (unsigned int i = 0; i < generationSize; i++) {
CrossoverChanceType random = (rand() + 1 % 10000) / 10000.0;