Bonmin
1.7
|
00001 // (C) Copyright Carnegie Mellon University 2005 00002 // All Rights Reserved. 00003 // This code is published under the Common Public License. 00004 // 00005 // Authors : 00006 // P. Bonami, Carnegie Mellon University 00007 // 00008 // Date : 05/26/2005 00009 00010 #ifndef BonDummyHeuristic_HPP 00011 #define BonDummyHeuristic_HPP 00012 #include "BonOsiTMINLPInterface.hpp" 00013 00014 #include "CbcHeuristic.hpp" 00015 namespace Bonmin 00016 { 00017 class DummyHeuristic : public CbcHeuristic 00018 { 00019 public: 00021 DummyHeuristic(OsiTMINLPInterface * si = NULL); 00023 DummyHeuristic(CbcModel &model, OsiTMINLPInterface * si = NULL); 00025 DummyHeuristic( const DummyHeuristic ©): 00026 CbcHeuristic(copy), 00027 nlp_(copy.nlp_), 00028 knowsSolution(copy.knowsSolution) 00029 {} 00031 void setNlp(OsiTMINLPInterface * si); 00033 virtual int solution(double &solutionValue, double *betterSolution); 00034 virtual int solution(double &solutionValue, double *betterSolution, OsiCuts & cs) 00035 { 00036 return solution(solutionValue, betterSolution); 00037 } 00038 virtual CbcHeuristic * clone()const 00039 { 00040 return new DummyHeuristic(*this); 00041 } 00042 virtual void resetModel(CbcModel*) 00043 {} 00044 virtual bool shouldHeurRun(int whereFrom){ 00045 return true;} 00046 private: 00048 OsiTMINLPInterface * nlp_; 00050 bool knowsSolution; 00051 }; 00052 } 00053 #endif