Ignore:
Timestamp:
Feb 13, 2008 3:52:57 PM (11 years ago)
Author:
forrest
Message:

add diving heuristics

File:
1 edited

Legend:

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

    r862 r871  
    155155#include "CbcHeuristicFPump.hpp"
    156156#include "CbcHeuristicRINS.hpp"
     157#include "CbcHeuristicDiveCoefficient.hpp"
     158#include "CbcHeuristicDiveFractional.hpp"
     159#include "CbcHeuristicDiveGuided.hpp"
     160#include "CbcHeuristicDiveVectorLength.hpp"
    157161#include "CbcTreeLocal.hpp"
    158162#include "CbcCompareActual.hpp"
     
    32083212  int useRINS = parameters_[whichParam(RINS,numberParameters_,parameters_)].currentOptionAsInteger();
    32093213  int useRENS = parameters_[whichParam(RENS,numberParameters_,parameters_)].currentOptionAsInteger();
     3214  int useDIVING = parameters_[whichParam(DIVING,numberParameters_,parameters_)].currentOptionAsInteger();
    32103215  // FPump done first as it only works if no solution
    32113216  int kType = (type<3) ? type : 1;
     
    33493354      heuristic5.setDecayFactor(1.5);
    33503355    model->addHeuristic(&heuristic5) ;
     3356    anyToDo=true;
     3357  }
     3358  // change later?
     3359  if (useDIVING>=kType) {
     3360    if ((useDIVING&1)!=0) {
     3361      CbcHeuristicDiveCoefficient heuristicDC(*model);
     3362      heuristicDC.setHeuristicName("DiveCoefficient");
     3363      model->addHeuristic(&heuristicDC) ;
     3364    }
     3365    if ((useDIVING&2)!=0) {
     3366      CbcHeuristicDiveFractional heuristicDF(*model);
     3367      heuristicDF.setHeuristicName("DiveFractional");
     3368      model->addHeuristic(&heuristicDF) ;
     3369    }
     3370    if ((useDIVING&4)!=0) {
     3371      CbcHeuristicDiveGuided heuristicDG(*model);
     3372      heuristicDG.setHeuristicName("DiveGuided");
     3373      model->addHeuristic(&heuristicDG) ;
     3374    }
     3375    if ((useDIVING&8)!=0) {
     3376      CbcHeuristicDiveVectorLength heuristicDV(*model);
     3377      heuristicDV.setHeuristicName("DiveVectorLength");
     3378      model->addHeuristic(&heuristicDV) ;
     3379    }
    33513380    anyToDo=true;
    33523381  }
     
    43164345            }
    43174346          } else {
    4318             parameters_[iParam].setCurrentOption(action,!noPrinting_);
     4347            const char * message =
     4348              parameters_[iParam].setCurrentOptionWithMessage(action);
     4349            if (!noPrinting_) {
     4350              generalMessageHandler->message(CLP_GENERAL,generalMessages)
     4351                << message
     4352                <<CoinMessageEol;
     4353            }
    43194354            // for now hard wired
    43204355            switch (type) {
     
    45254560              break;
    45264561            case GREEDY:
    4527               defaultSettings=false; // user knows what she is doing
    4528               break;
     4562            case DIVING:
    45294563            case COMBINE:
    4530               defaultSettings=false; // user knows what she is doing
    4531               break;
    45324564            case LOCALTREE:
    45334565              defaultSettings=false; // user knows what she is doing
Note: See TracChangeset for help on using the changeset viewer.