X-Git-Url: https://git.dlugolecki.net.pl/?p=genetic.git;a=blobdiff_plain;f=include%2Fgeneration.h;h=f460a7fbe62cc408a6034b8ad42bf84420d9f78d;hp=88942ec0d9fd2a0cac8e19b3762bee8cef227da8;hb=0c268e96035b65112e449c1c0df49f2be3eb184f;hpb=917440678dc4e920dfd5810da1274665acb17138 diff --git a/include/generation.h b/include/generation.h index 88942ec..f460a7f 100644 --- a/include/generation.h +++ b/include/generation.h @@ -32,7 +32,7 @@ namespace genetic { * * @param chromosomes vector containing Chromosomes to use in Generation */ - Generation(vector<_Chromosome> chromosomes) { + Generation(const std::vector<_Chromosome>& chromosomes) { this->chromosomes = chromosomes; } @@ -66,7 +66,7 @@ namespace genetic { * * @return i-th Chromosome in the current Generation */ - _Chromosome& operator[](unsigned int i) { + _Chromosome& operator[](const unsigned int i) { return this->chromosomes[i]; } };