Bonmin
1.7
|
00001 // Copyright (C) 2007, International Business Machines Corporation and others. 00002 // All Rights Reserved. 00003 // This code is published under the Common Public License. 00004 // 00005 // Authors : 00006 // Joao P. Goncalves, International Business Machines Corporation 00007 // 00008 // Date : November 12, 2007 00009 00010 #ifndef BonHeuristicDiveMIP_HPP 00011 #define BonHeuristicDiveMIP_HPP 00012 #include "BonOsiTMINLPInterface.hpp" 00013 #include "BonBonminSetup.hpp" 00014 #include "CbcHeuristic.hpp" 00015 #include "CbcStrategy.hpp" 00016 namespace Bonmin 00017 { 00018 class SubMipSolver; 00019 class HeuristicDiveMIP : public CbcHeuristic 00020 { 00021 public: 00022 #if 0 00023 00024 HeuristicDiveMIP(); 00025 #endif 00026 00028 HeuristicDiveMIP(BonminSetup * setup); 00029 00031 HeuristicDiveMIP(const HeuristicDiveMIP ©); 00032 00034 ~HeuristicDiveMIP(); 00035 00037 HeuristicDiveMIP & operator=(const HeuristicDiveMIP & rhs); 00038 00040 virtual CbcHeuristic * clone() const = 0; 00041 00043 void Initialize(BonminSetup * setup); 00044 00046 virtual void resetModel(CbcModel * model){ 00047 setModel(model); 00048 } 00049 00051 virtual void setSetup(BonminSetup * setup){ 00052 setup_ = setup; 00053 // Initialize(setup_->options()); 00054 } 00055 00057 virtual int solution(double &solutionValue, double *betterSolution); 00058 00060 virtual void setInternalVariables(TMINLP2TNLP* minlp) = 0; 00061 00063 00065 virtual void selectVariableToBranch(TMINLP2TNLP* minlp, 00066 const vector<int> & integerColumns, 00067 const double* newSolution, 00068 int& bestColumn, 00069 int& bestRound) = 0; 00070 00071 protected: 00073 BonminSetup * setup_; 00074 00075 private: 00077 int howOften_; 00079 SubMipSolver * mip_; 00080 00081 }; 00082 } 00083 #endif