X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=src%2Ffitness%2Fwsti.h;h=b93439f204466028c6d6ba021a15d47ae2bcae7f;hb=1014b8296cc38f408212d385f036cc78e9c66cce;hp=028c32220098425fd836d1c18580845501aad136;hpb=46357591de1336612d4c26170cd59c13543b5169;p=genetic.git diff --git a/src/fitness/wsti.h b/src/fitness/wsti.h index 028c322..b93439f 100644 --- a/src/fitness/wsti.h +++ b/src/fitness/wsti.h @@ -20,13 +20,13 @@ namespace genetic { float span_end; double fenotype() { - int fen = 0; - int rat = 1; + int _fenotype = 0; + int ratio = 1; for (unsigned int i = 0; i < chromosome.get().size(); i++) { - fen = fen + chromosome.get()[i].get() * rat; - rat = rat * 2; + _fenotype = _fenotype + chromosome.get()[i].get() * ratio; + ratio = ratio * 2; } - return fen; + return _fenotype; } double calculateFenotype() {