[Coin-lpsolver] CoinSeedRandom

Matthew Galati magh at lehigh.edu
Wed Jan 21 16:38:17 EST 2004


Hi CLP,

Debugging some code using CLP, I was getting different answers from two 
consecutive runs on the same problem set. Seems CLP has some randomness 
built in through several calls to CoinDrand48(), which calls drand48().

According to the man on drand48
"The srand48(), seed48()  and  lcong48()  functions  are  initialization
       functions,  one  of  which  should  be  called  before using 
drand48()"

That is, I am not sure what drand48 uses if it is not first initialized, 
maybe the current timestamp(?). I don't see any reference to 
CoinSeedRandom in CLP or OsiClp. The user can force this by calling 
CoinSeedRandom(some constant) before any solver call to CLP. Maybe the 
CLP constructor should seed the random number generator to some 
constant, for the sake of repeatability/testing/debugging.? Or, maybe we 
can make this a parameter or compiler option.

Matt

-- 
Matthew Galati
ISE Lehigh University
IBM Service Parts Solutions
610.758.4042 (Office)
610.882.0779 (Home)
magh at lehigh.edu, magal11 at us.ibm.com
http://sagan.ie.lehigh.edu/mgalati/





More information about the Clp mailing list