jameschch / LeanOptimization

Genetic optimization using LEAN
Apache License 2.0
50 stars 14 forks source link

Setting "max" of genes in optimization.json not working as expected #24

Closed sicsix closed 5 years ago

sicsix commented 7 years ago

The maximum value of a gene needs to be set to n+1 to work as would be expected.

For Example if I set the "min" to 1 and the "max" to 10, the actual range that will be tested will be between 1 and 9.

jameschch commented 7 years ago

Great spot. The max was just passed into standard Random.Next(min, max) which has an exclusive upper bound. This was fixed with latest commit. This issue will not have affected genes with precision.