9 #ifndef BonLocalSolverBasedHeuristic_H
10 #define BonLocalSolverBasedHeuristic_H
12 #include "CbcHeuristic.hpp"
30 virtual CbcHeuristic *
clone()
const = 0;
36 virtual void setModel(CbcModel * model){
throw -1;}
50 virtual int solution(
double & objectiveValue,
51 double * newSolution)=0;
56 OsiCuts & cs) {
return 0;}
63 double cutoff, std::string
prefix =
"local_solver.")
const;
79 const std::string &option,
80 const std::string &value);
84 const std::string &option,
89 const std::string &option,
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
~LocalSolverBasedHeuristic()
Destructor.
virtual int solution(double &objectiveValue, double *newSolution, OsiCuts &cs)
Performs heuristic which adds cuts.
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register the options common to all local search based heuristics.
int max_number_nodes_
maximal number of nodes in local search.
double time_limit_
Time limit in local search.
LocalSolverBasedHeuristic & operator=(const LocalSolverBasedHeuristic &rhs)
Assignment operator.
int doLocalSearch(OsiTMINLPInterface *solver, double *solution, double &solValue, double cutoff, std::string prefix="local_solver.") const
Do a local search based on setup and passed solver.
LocalSolverBasedHeuristic()
Default constructor.
void Initialize(Ipopt::SmartPtr< Ipopt::OptionsList > options)
Initiaize using passed options.
virtual int solution(double &objectiveValue, double *newSolution)=0
Performs heuristic.
void setSetup(BonminSetup *setup)
Change setup used for heuristic.
static void changeIfNotSet(Ipopt::SmartPtr< Ipopt::OptionsList > options, std::string prefix, const std::string &option, const std::string &value)
virtual void setupDefaults(Ipopt::SmartPtr< Ipopt::OptionsList > options)
Setup the defaults.
Ipopt::SmartPtr< Ipopt::OptionsList > options()
Acces list of Options.
int max_number_solutions_
Maximal number of solutions in local search.
virtual CbcHeuristic * clone() const =0
Virtual copy constructor.
BonminSetup * setup_
Setup to use for local searches (will make copies).