Changeset 2946


Ignore:
Timestamp:
Apr 2, 2020 2:55:56 PM (3 months ago)
Author:
unxusr
Message:

set random seed in C interface

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Cbc_C_Interface.cpp

    r2920 r2946  
    15141514{
    15151515  CoinMessages generalMessages = model->solver_->getModelPtr()->messages();
     1516  model->solver_->getModelPtr()->setRandomSeed( model->int_param[INT_PARAM_RANDOM_SEED] );
    15161517
    15171518  Cbc_flush( model );
     
    18801881#endif
    18811882    model->cbcModel_->setRoundIntegerVariables( model->int_param[INT_PARAM_ROUND_INT_VARS] );
     1883    model->cbcModel_->setRandomSeed(model->int_param[INT_PARAM_RANDOM_SEED]);
     1884
    18821885    CbcMain1( nargs, args, *model->cbcModel_, cbc_callb, cbcData );
    18831886
  • trunk/src/Cbc_C_Interface.h

    r2920 r2946  
    101101  INT_PARAM_MAX_SAVED_SOLS      = 12, /*! Size of the pool to save the best solutions found during the search. */
    102102  INT_PARAM_MULTIPLE_ROOTS      = 13, /*! Multiple root passes to get additional cuts and solutions. */
    103   INT_PARAM_ROUND_INT_VARS      = 14  /*! If integer variables should be round to remove small infeasibilities. This can increase the overall amount of infeasibilities in problems with both continuous and integer variables */
     103  INT_PARAM_ROUND_INT_VARS      = 14, /*! If integer variables should be round to remove small infeasibilities. This can increase the overall amount of infeasibilities in problems with both continuous and integer variables */
     104  INT_PARAM_RANDOM_SEED         = 15  /*! When solving LP and MIP, randomization is used to break ties in some decisions. This changes the random seed so that multiple executions can produce different results */
    104105};
    105 #define N_INT_PARAMS 15
     106#define N_INT_PARAMS 16
    106107 
    107108/** typedef for cbc callback to monitor the progress of the search
Note: See TracChangeset for help on using the changeset viewer.