Skip to content

Commit

Permalink
Prevent bias towards left side of the image, improving accuracy of th…
Browse files Browse the repository at this point in the history
…e algorithm
  • Loading branch information
rh12503 committed Apr 24, 2021
1 parent 54f93f7 commit bd2954c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mutation/gaussian.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func (g gaussianMethod) Mutate(points normgeom.NormPointGroup, mutated func(muta
if random.Float32() < g.rate {
old := points[i]

points[i].X += (random.NormFloat64() - 0.5) * g.amount
points[i].Y += (random.NormFloat64() - 0.5) * g.amount
points[i].X += random.NormFloat64() * g.amount * 0.5
points[i].Y += random.NormFloat64() * g.amount * 0.5

points[i].Constrain()

Expand Down

0 comments on commit bd2954c

Please sign in to comment.