prevent duplicate sample of next generation

This commit is contained in:
Johannes Merl 2024-02-12 15:40:35 +01:00
parent 1ae23c20ee
commit 62cf1acc6d

View File

@ -258,8 +258,7 @@ run select nParents nX pElite pop term = do
then return currPop'
else do
let nextPop = stepSteady select nParents nX pElite currPop'
nextPop' <- lift $ sampleFrom mwc $ nextPop
let fBest = fitness $ NE.head $ fst $ bests 1 nextPop'
let fBest = fitness $ NE.head $ fst $ bests 1 currPop'
Pipes.yield (generation, fBest)
x nextPop (generation + 1)
x pop 0