CbcHeuristicFPump.hpp
Go to the documentation of this file.
1 /* $Id: CbcHeuristicFPump.hpp 1432 2010-02-07 19:33:53Z bjarni $ */
2 // Copyright (C) 2004, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef CbcHeuristicFeasibilityPump_H
5 #define CbcHeuristicFeasibilityPump_H
6 
7 #include "CbcHeuristic.hpp"
8 #include "OsiClpSolverInterface.hpp"
9 
14 public:
15 
16  // Default Constructor
18 
19  // Constructor with model - assumed before cuts
20  CbcHeuristicFPump (CbcModel & model,
21  double downValue = 0.5, bool roundExpensive = false);
22 
23  // Copy constructor
25 
26  // Destructor
28 
32  virtual CbcHeuristic * clone() const;
34  virtual void generateCpp( FILE * fp) ;
35 
37  virtual void resetModel(CbcModel * model);
38 
40  virtual void setModel(CbcModel * model);
41 
63  virtual int solution(double & objectiveValue,
64  double * newSolution);
65 
67  void setMaximumTime(double value);
69  inline double maximumTime() const {
70  return maximumTime_;
71  }
73  inline void setFakeCutoff(double value) {
74  fakeCutoff_ = value;
75  }
77  inline double fakeCutoff() const {
78  return fakeCutoff_;
79  }
81  inline void setAbsoluteIncrement(double value) {
82  absoluteIncrement_ = value;
83  }
85  inline double absoluteIncrement() const {
86  return absoluteIncrement_;
87  }
89  inline void setRelativeIncrement(double value) {
90  relativeIncrement_ = value;
91  }
93  inline double relativeIncrement() const {
94  return relativeIncrement_;
95  }
97  inline void setDefaultRounding(double value) {
98  defaultRounding_ = value;
99  }
101  inline double defaultRounding() const {
102  return defaultRounding_;
103  }
105  inline void setInitialWeight(double value) {
106  initialWeight_ = value;
107  }
109  inline double initialWeight() const {
110  return initialWeight_;
111  }
113  inline void setWeightFactor(double value) {
114  weightFactor_ = value;
115  }
117  inline double weightFactor() const {
118  return weightFactor_;
119  }
121  inline void setArtificialCost(double value) {
122  artificialCost_ = value;
123  }
125  inline double artificialCost() const {
126  return artificialCost_;
127  }
129  inline double iterationRatio() const {
130  return iterationRatio_;
131  }
133  inline void setIterationRatio(double value) {
134  iterationRatio_ = value;
135  }
137  inline void setMaximumPasses(int value) {
138  maximumPasses_ = value;
139  }
141  inline int maximumPasses() const {
142  return maximumPasses_;
143  }
145  inline void setMaximumRetries(int value) {
146  maximumRetries_ = value;
147  }
149  inline int maximumRetries() const {
150  return maximumRetries_;
151  }
173  inline void setAccumulate(int value) {
174  accumulate_ = value;
175  }
177  inline int accumulate() const {
178  return accumulate_;
179  }
185  inline void setFixOnReducedCosts(int value) {
186  fixOnReducedCosts_ = value;
187  }
189  inline int fixOnReducedCosts() const {
190  return fixOnReducedCosts_;
191  }
196  inline void setReducedCostMultiplier(double value) {
197  reducedCostMultiplier_ = value;
198  }
200  inline double reducedCostMultiplier() const {
201  return reducedCostMultiplier_;
202  }
203 
204 protected:
205  // Data
207  double startTime_;
209  double maximumTime_;
213  double fakeCutoff_;
259 
260 private:
265  int rounds(OsiSolverInterface * solver, double * solution,
266  /*const double * objective, */
267  int numberIntegers, const int * integerVariable,
268  /*char * pumpPrint,*/int passNumber,
269  /*bool roundExpensive=false,*/
270  double downValue = 0.5, int *flip = 0);
271  /* note for eagle eyed readers.
272  when_ can now be exotic -
273  <=10 normal
274  */
275 };
276 
277 # ifdef COIN_HAS_CLP
278 
279 class CbcDisasterHandler : public OsiClpDisasterHandler {
280 public:
284 #ifdef JJF_ZERO
285 
286  virtual void intoSimplex();
288  virtual bool check() const ;
290  virtual void saveInfo();
291 #endif
292 
293  virtual int typeOfDisaster();
295 
296 
301  CbcDisasterHandler(CbcModel * model = NULL);
303  virtual ~CbcDisasterHandler();
304  // Copy
305  CbcDisasterHandler(const CbcDisasterHandler&);
306  // Assignment
307  CbcDisasterHandler& operator=(const CbcDisasterHandler&);
309  virtual ClpDisasterHandler * clone() const;
310 
312 
317  void setCbcModel(CbcModel * model);
319  inline CbcModel * cbcModel() const {
320  return cbcModel_;
321  }
322 
324 
325 
326 protected:
330 
331  CbcModel * cbcModel_;
332 
334 };
335 #endif
336 
337 #endif
338