chickadee » aima » simulate

simulate environmentprocedure
simulate environment randomize! random-seedprocedure

Run an environment to completion; an environment is complete when it returns false.

environment
The environment to simulate
randomize!
Function to seed the random-number generator for reproducible results
random-seed
Seed to seed the random-number generator
(define simulate
  (case-lambda
    ((environment) (simulate environment (randomize!) (random-seed)))
    ((environment randomize! random-seed)
     (if random-seed (randomize! random-seed))
     (loop ((while (environment)))))))