00001 // Copyright (C) 2006, International Business Machines 00002 // Corporation and others. All Rights Reserved. 00003 #ifndef CbcHeuristicRINS_H 00004 #define CbcHeuristicRINS_H 00005 00006 #include "CbcHeuristic.hpp" 00010 class CbcHeuristicRINS : public CbcHeuristic { 00011 public: 00012 00013 // Default Constructor 00014 CbcHeuristicRINS (); 00015 00016 /* Constructor with model - assumed before cuts 00017 Initial version does not do Lps 00018 */ 00019 CbcHeuristicRINS (CbcModel & model); 00020 00021 // Copy constructor 00022 CbcHeuristicRINS ( const CbcHeuristicRINS &); 00023 00024 // Destructor 00025 ~CbcHeuristicRINS (); 00026 00028 virtual CbcHeuristic * clone() const; 00029 00030 00032 CbcHeuristicRINS & operator=(const CbcHeuristicRINS& rhs); 00033 00035 virtual void generateCpp( FILE * fp) ; 00036 00038 virtual void resetModel(CbcModel * model); 00039 00041 virtual void setModel(CbcModel * model); 00042 00043 using CbcHeuristic::solution ; 00048 virtual int solution(double & objectiveValue, 00049 double * newSolution); 00051 int solutionFix(double & objectiveValue, 00052 double * newSolution, 00053 const int * keep); 00054 00056 inline void setHowOften(int value) 00057 { howOften_=value;} 00059 inline void setDecayFactor(double value) 00060 { decayFactor_=value;} 00062 inline char * used() const 00063 { return used_;} 00064 00065 protected: 00066 // Data 00067 00069 int numberSolutions_; 00071 int howOften_; 00073 double decayFactor_; 00075 int numberSuccesses_; 00077 int numberTries_; 00079 char * used_; 00080 }; 00081 00085 class CbcHeuristicRENS : public CbcHeuristic { 00086 public: 00087 00088 // Default Constructor 00089 CbcHeuristicRENS (); 00090 00091 /* Constructor with model - assumed before cuts 00092 Initial version does not do Lps 00093 */ 00094 CbcHeuristicRENS (CbcModel & model); 00095 00096 // Copy constructor 00097 CbcHeuristicRENS ( const CbcHeuristicRENS &); 00098 00099 // Destructor 00100 ~CbcHeuristicRENS (); 00101 00103 virtual CbcHeuristic * clone() const; 00104 00105 00107 CbcHeuristicRENS & operator=(const CbcHeuristicRENS& rhs); 00108 00110 virtual void resetModel(CbcModel * model); 00111 00113 virtual void setModel(CbcModel * model); 00114 00115 using CbcHeuristic::solution ; 00120 virtual int solution(double & objectiveValue, 00121 double * newSolution); 00122 00123 protected: 00124 // Data 00126 int numberTries_; 00127 }; 00128 00129 00130 #endif