Ignore:
Timestamp:
Jan 7, 2011 12:16:00 PM (10 years ago)
Author:
forrest
Message:

add some sos heuristics

File:
1 edited

Legend:

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

    r1573 r1582  
    4242#include "CbcHeuristic.hpp"
    4343#include "CbcHeuristicLocal.hpp"
     44#include "CbcHeuristicRINS.hpp"
    4445
    4546// Default Constructor
     
    925926    if (!found)
    926927        model.addHeuristic(&heuristic1);
     928    if ((model.moreSpecialOptions()&32768)!=0) {
     929      // Allow join solutions
     930      CbcHeuristicLocal heuristic2(model);
     931      heuristic2.setHeuristicName("join solutions");
     932      //sheuristic2.setSearchType(1);
     933      found = false;
     934      for (iHeuristic = 0; iHeuristic < numberHeuristics; iHeuristic++) {
     935        CbcHeuristic * heuristic = model.heuristic(iHeuristic);
     936        CbcHeuristicLocal * cgl = dynamic_cast<CbcHeuristicLocal *>(heuristic);
     937        if (cgl) {
     938          found = true;
     939          break;
     940        }
     941      }
     942      if (!found)
     943        model.addHeuristic(&heuristic2);
     944      // Allow RINS
     945      CbcHeuristicRINS heuristic5(model);
     946      heuristic5.setHeuristicName("RINS");
     947      heuristic5.setFractionSmall(0.5);
     948      heuristic5.setDecayFactor(5.0);
     949      //heuristic5.setSearchType(1);
     950      found = false;
     951      for (iHeuristic = 0; iHeuristic < numberHeuristics; iHeuristic++) {
     952        CbcHeuristic * heuristic = model.heuristic(iHeuristic);
     953        CbcHeuristicLocal * cgl = dynamic_cast<CbcHeuristicLocal *>(heuristic);
     954        if (cgl) {
     955          found = true;
     956          break;
     957        }
     958      }
     959      if (!found)
     960        model.addHeuristic(&heuristic5);
     961    }
    927962}
    928963// Do printing stuff
Note: See TracChangeset for help on using the changeset viewer.