algebolic icon indicating copy to clipboard operation
algebolic copied to clipboard

Ability to seed random number generator

Open JonyEpsilon opened this issue 11 years ago • 2 comments

Will probably need to switch all of the random calls. Not sure how this will work with multi-threading.

JonyEpsilon avatar Sep 15 '14 16:09 JonyEpsilon

This is going to be be difficult to make work with multi-core operation.

JonyEpsilon avatar Sep 16 '14 12:09 JonyEpsilon

Need to figure out a way to do this, at least in test fixtures, as it's painful having to track down bugs by hand. A fallback option would be to feed the random numbers into the functions that need them:

(defn crossover-internal [expr1 expr1 p1 p2] ...)

(defn crossover [expr1 expr2]
  (crossover-internal expr1 expr1 (rand (size expr1)) (rand (size expr2))))

At least, then, crossover-internal would be testable.

JonyEpsilon avatar Sep 23 '14 16:09 JonyEpsilon