[gecode-users] Value selection when branching

Lars Otten ottenl at student.chalmers.se
Thu Feb 9 14:13:29 CET 2006


On 02/07/06 16:47, Mikael 'Zayenz' Lagerkvist wrote:
> In test/random.cc in the gecode directory, there is a linear
> congruential random number generator suggested as "good enough" by
> Knuth for applications where "true" randomness is not that important.
> It is simple, and has a clear value for it's state. This could be a
> good starting-point for you.

Thanks for the hint, this did indeed prove to be a good starting point,
together with the details in Knuth's book.

By the way, I think there's a little bug in the random.cc code:

  void seed(unsigned int val) {
    if(val) x = val % m;
    else    val = 1;  // shouldn't that be x=1 ?
  }

Cheers,
/Lars




More information about the gecode-users mailing list