tylercamp / palcalc

MIT License
33 stars 5 forks source link

Incomplete handling of optional traits when parents have > 4 total desired traits #17

Closed tylercamp closed 6 months ago

tylercamp commented 6 months ago

https://github.com/tylercamp/palcalc/blob/main/PalCalc.Solver/BreedingSolver.cs#L228

If there are 2 required traits and 4 optional traits in the solver, and two parents contain all 6 traits between them, the solver will attempt to calculate the probability of inheriting 6 traits, which is not possible and no children will be produced.

When the total desired traits exceeds the max, we should generate permutations of required + optional traits up to the max of 4.

tylercamp commented 6 months ago

Fixed with https://github.com/tylercamp/palcalc/commit/d4be2000c5d22c0e7acaf1a2c22a9a3288d78a6f pending release

tylercamp commented 6 months ago

Fixed in v1.4.2