
Thanks Stefan,
Sorry for sending the message to the bug list. My first post to
the users mailing list seems to get lost somewhere. I therefore try
my luck on the bug list. It seems to work :)
I am extending my polyGP system using the new haskell compiler.
The random number is to be used for selecting crossover/mutation
points, not to be printed (not IO type). I tried the following and they
seem to work fine.
-- get a list of random int between 1 and 250
drawInt :: [Int]
drawInt = randomRs (1, 250)(mkStdGen 10)
-- get a list of random double between 0 and 100
drawDouble :: [Double]
drawDouble = randomRs (0, 100) (mkStdGen 100)
Are they really random numbers ? I am wodering why all
random double has values < 1.0. Do you know ? Thanks !!
Tina
Stefan Reich
Hi,
I need some assistances in calling random number generator using 6.0.1 haskell compiler. To return a list of random int [Int], I have tried the following:
drawInt :: Int->Int -> [Int] drawInt x y = getStdRandom (randomRs (x,y))
It has a type error. I would appreciate if you know how to fix it.
Thank you in advance.
Tina Yu http://www.improvise.ws
--------------------------------- Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes