Changeset 1058


Ignore:
Timestamp:
Sep 5, 2008 11:52:14 AM (10 years ago)
Author:
forrest
Message:

allow pivot and fix or randomized rounding

Location:
trunk/Cbc/src
Files:
2 edited

Legend:

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

    r1055 r1058  
    8282
    8383  numCouldRun_++;
     84  printf("entered pivot and fix\n");
    8485  int returnCode = 0;
    8586  return returnCode;
  • trunk/Cbc/src/CbcSolver.cpp

    r1053 r1058  
    157157#include "CbcHeuristic.hpp"
    158158#include "CbcHeuristicLocal.hpp"
     159#include "CbcHeuristicPivotAndFix.hpp"
     160#include "CbcHeuristicRandRound.hpp"
    159161#include "CbcHeuristicGreedy.hpp"
    160162#include "CbcHeuristicFPump.hpp"
     
    508510  parameters_[whichParam(GREEDY,numberParameters_,parameters_)].setCurrentOption("on");
    509511  parameters_[whichParam(COMBINE,numberParameters_,parameters_)].setCurrentOption("on");
     512  parameters_[whichParam(PIVOTANDFIX,numberParameters_,parameters_)].setCurrentOption("off");
     513  parameters_[whichParam(RANDROUND,numberParameters_,parameters_)].setCurrentOption("off");
    510514  parameters_[whichParam(RINS,numberParameters_,parameters_)].setCurrentOption("off");
    511515  parameters_[whichParam(DINS,numberParameters_,parameters_)].setCurrentOption("off");
     
    32093213  parameters[whichParam(GREEDY,numberParameters,parameters)].setCurrentOption("on");
    32103214  parameters[whichParam(COMBINE,numberParameters,parameters)].setCurrentOption("on");
     3215  parameters[whichParam(PIVOTANDFIX,numberParameters,parameters)].setCurrentOption("off");
     3216  parameters[whichParam(RANDROUND,numberParameters,parameters)].setCurrentOption("off");
    32113217  parameters[whichParam(RINS,numberParameters,parameters)].setCurrentOption("off");
    32123218  parameters[whichParam(DINS,numberParameters,parameters)].setCurrentOption("off");
     
    32373243  int useGreedy = parameters_[whichParam(GREEDY,numberParameters_,parameters_)].currentOptionAsInteger();
    32383244  int useCombine = parameters_[whichParam(COMBINE,numberParameters_,parameters_)].currentOptionAsInteger();
     3245  int usePivot = parameters_[whichParam(PIVOTANDFIX,numberParameters_,parameters_)].currentOptionAsInteger();
     3246  int useRand = parameters_[whichParam(RANDROUND,numberParameters_,parameters_)].currentOptionAsInteger();
    32393247  int useRINS = parameters_[whichParam(RINS,numberParameters_,parameters_)].currentOptionAsInteger();
    32403248  int useRENS = parameters_[whichParam(RENS,numberParameters_,parameters_)].currentOptionAsInteger();
     
    34823490      model->addHeuristic(&heuristicDP) ;
    34833491    }
     3492    anyToDo=true;
     3493  }
     3494  if (usePivot>=type) {
     3495    CbcHeuristicPivotAndFix heuristic(*model);
     3496    heuristic.setHeuristicName("pivot and fix");
     3497    heuristic.setFractionSmall(10.0); // normally 0.5
     3498    model->addHeuristic(&heuristic);
     3499    anyToDo=true;
     3500  }
     3501  if (useRand>=type) {
     3502    CbcHeuristicRandRound heuristic(*model);
     3503    heuristic.setHeuristicName("randomized rounding");
     3504    heuristic.setFractionSmall(10.0); // normally 0.5
     3505    model->addHeuristic(&heuristic);
    34843506    anyToDo=true;
    34853507  }
     
    48044826            case DIVINGV:
    48054827            case COMBINE:
     4828            case PIVOTANDFIX:
     4829            case RANDROUND:
    48064830            case LOCALTREE:
    48074831              defaultSettings=false; // user knows what she is doing
Note: See TracChangeset for help on using the changeset viewer.