_Value fenotype() {
int _fenotype = 0;
int ratio = 1;
- for (unsigned int i = 0; i < this->chromosome.size(); i++) {
+ unsigned int chromosomeSize = this->chromosome.size();
+
+ for (unsigned int i = 0; i < chromosomeSize; i++) {
_fenotype = _fenotype + this->chromosome[i].get() * ratio;
ratio = ratio * 2;
}