Ignore:
Timestamp:
Nov 22, 2012 2:00:22 PM (7 years ago)
Author:
forrest
Message:

add random seed setting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcHeuristic.cpp

    r1802 r1813  
    453453CbcHeuristic::setSeed(int value)
    454454{
     455    if (value==0) {
     456      double time = fabs(CoinGetTimeOfDay());
     457      while (time>=COIN_INT_MAX)
     458        time *= 0.5;
     459      value = static_cast<int>(time);
     460      char printArray[100];
     461      sprintf(printArray, "using time of day seed was changed from %d to %d",
     462              randomNumberGenerator_.getSeed(), value);
     463      if (model_)
     464        model_->messageHandler()->message(CBC_FPUMP1, model_->messages())
     465          << printArray
     466          << CoinMessageEol;
     467    }
    455468    randomNumberGenerator_.setSeed(value);
    456469}
Note: See TracChangeset for help on using the changeset viewer.