[CM] CM random seed

Rick Taube taube@uiuc.edu
Fri, 20 May 2005 20:01:14 -0500


Dont manipulate its printed representation, that will change from lisp 
to lisp anyway. just use make-random-state to create it,  save it in 
some variable that you use to pass it to functions:

? (defparameter rstate (make-random-state nil))
? rstate
#.(RANDOM-STATE 64497 9)
? (loop repeat 10 collect (ran :type :uniform :state rstate))
(0.8205207 0.9152834 0.17589653 0.70255244 0.27051756 0.6529134 
0.8977197 0.3460406 0.759235 0.29800546)
? rstate
#.(RANDOM-STATE 7684 54345)

On May 20, 2005, at 7:32 PM, Joshua Parmenter wrote:

> Shouldn't this work then?
>
> ? *random-state*
> #.(RANDOM-STATE 29972 27939)
> ? (loop for i from 0 below 10 collect (ran :state #.(RANDOM-STATE 
> 29972 27939)))
>
> > Error in process listener(4): Undefined function RANDOM-STATE called 
> with arguments (29972 27939) .
> > While executing: "Unknown"
> > Type :GO to continue, :POP to abort.
> > If continued: Retry applying RANDOM-STATE to (29972 27939).
> Type :? for other options.
> 1 > 
>
> is this not the correct way to pass in a random state to the state arg?
>
> Thanks,
>
> Josh