Re: Obtain Random.self_init seed
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <CAPFanBE5YeZ+j2tufw=ZKqXXQtS4G+5JP6YhzcrWZPGhWqsuHQ@mail.gmail.com> |
Random.get_state () will return the current state of the random generator. This is of the abstract type Random.State.t, but it is reasonable to assume it is marshallable. Calling random-generation function mutates the random state in place; so if you plan to first generate random numbers and only later decide whether you want to keep the initial state around, you should use Random.state.copy to make an independent copy of it that won't be affected by random-number generation, and save the copy. On Sun, Dec 14, 2014 at 3:51 PM, Johan Mazel [email protected] [ocaml_beginners] <[email protected]> wrote: > > > > Hi > I am launching many executions of a program and I use self_init. > Some execution trigger an error. > > I would to be able to reliably extract the seed that generate the error in > order to reproduce the output and identify the problem. > Is there something available to extract the seed generated by self_init ? > > Regards. > Johan > > > >