Bonmin  1.8.8
BonHeuristicDiveMIP.hpp
Go to the documentation of this file.
1 // Copyright (C) 2007, International Business Machines Corporation and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors :
6 // Joao P. Goncalves, International Business Machines Corporation
7 //
8 // Date : November 12, 2007
9 
10 #ifndef BonHeuristicDiveMIP_HPP
11 #define BonHeuristicDiveMIP_HPP
13 #include "BonBonminSetup.hpp"
14 #include "CbcHeuristic.hpp"
15 #include "CbcStrategy.hpp"
16 namespace Bonmin
17 {
18  class SubMipSolver;
19  class HeuristicDiveMIP : public CbcHeuristic
20  {
21  public:
22 #if 0
25 #endif
26 
29 
32 
35 
38 
40  virtual CbcHeuristic * clone() const = 0;
41 
43  void Initialize(BonminSetup * setup);
44 
46  virtual void resetModel(CbcModel * model){
47  setModel(model);
48  }
49 
51  virtual void setSetup(BonminSetup * setup){
52  setup_ = setup;
53  // Initialize(setup_->options());
54  }
55 
57  virtual int solution(double &solutionValue, double *betterSolution);
58 
60  virtual void setInternalVariables(TMINLP2TNLP* minlp) = 0;
61 
63 
65  virtual void selectVariableToBranch(TMINLP2TNLP* minlp,
66  const vector<int> & integerColumns,
67  const double* newSolution,
68  int& bestColumn,
69  int& bestRound) = 0;
70 
71  protected:
74 
75  private:
77  int howOften_;
80 
81  };
82 }
83 #endif
virtual int solution(double &solutionValue, double *betterSolution)
Performs heuristic.
virtual void setInternalVariables(TMINLP2TNLP *minlp)=0
sets internal variables
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
BonminSetup * setup_
Setup to use for local searches (will make copies).
void Initialize(BonminSetup *setup)
Initialize method.
SubMipSolver * mip_
A subsolver for MIP.
A very simple class to provide a common interface for solving MIPs with Cplex and Cbc...
virtual void selectVariableToBranch(TMINLP2TNLP *minlp, const vector< int > &integerColumns, const double *newSolution, int &bestColumn, int &bestRound)=0
Selects the next variable to branch on.
~HeuristicDiveMIP()
Destructor.
HeuristicDiveMIP & operator=(const HeuristicDiveMIP &rhs)
Assignment operator.
virtual void setSetup(BonminSetup *setup)
Change setup used for heuristic.
virtual CbcHeuristic * clone() const =0
Clone.
This is an adapter class that converts a TMINLP to a TNLP to be solved by Ipopt.
HeuristicDiveMIP(BonminSetup *setup)
Constructor with setup.
int howOften_
How often to do (code can change)