Bonmin  1.8.8
BonCbcNlpStrategy.hpp
Go to the documentation of this file.
1 // (C) Copyright International Business Machines Corporation and Carnegie Mellon University 2006
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors :
6 // John J. Forrest, International Business Machines Corporation
7 // Pierre Bonami, Carnegie Mellon University,
8 //
9 // Date : 03/15/2006
10 
11 #ifndef BonCbcNlpStrategy_H
12 #define BonCbcNlpStrategy_H
13 
14 #include "CbcStrategy.hpp"
15 class CglPreProcess;
16 class CbcNodeInfo;
17 class CbcNode;
18 class CoinWarmStartDiff;
19 
20 
21 namespace Bonmin
22 {
23  class CbcNlpStrategy : public CbcStrategy
24  {
25  public:
26 
27  // Default Constructor
28  CbcNlpStrategy (int maxFailures,
29  int maxInfeasibles,
30  int pretendFailIsInfeasible);
31 
32  // Copy constructor
33  CbcNlpStrategy ( const CbcNlpStrategy &);
34 
35  // Destructor
36  virtual ~CbcNlpStrategy ();
37 
39  virtual CbcStrategy * clone() const;
40 
42  virtual CbcNodeInfo * fullNodeInfo(CbcModel * model,int numberRowsAtContinuous) const;
44  virtual CbcNodeInfo * partialNodeInfo(CbcModel * model, CbcNodeInfo * parent, CbcNode * owner,
45  int numberChangedBounds,const int * variables,
46  const double * boundChanges,
47  const CoinWarmStartDiff *basisDiff) const;
54  virtual int status(CbcModel * model, CbcNodeInfo * parent, int whereFrom);
56  inline void setMaxFailure(int value)
57  {
58  maxFailure_ = value;
59  }
61  inline void setMaxInfeasible(int value)
62  {
63  maxInfeasible_ = value;
64  }
65 
67  virtual void setupCutGenerators(CbcModel & model);
69  virtual void setupHeuristics(CbcModel & model);
71  virtual void setupPrinting(CbcModel & model,int modelLogLevel);
73  virtual void setupOther(CbcModel & model);
74 
75  bool hasFailed()
76  {
77  return hasFailed_;
78  }
79  protected:
80  // Data
82  bool hasFailed_;
90 
91  private:
94 
95  };
96 }
97 
98 #endif
void setMaxFailure(int value)
set maximum number of consecutive failures in a branch before giving up
virtual CbcNodeInfo * fullNodeInfo(CbcModel *model, int numberRowsAtContinuous) const
Return a new Full node information pointer (descendant of CbcFullNodeInfo)
int maxInfeasible_
maximum number of consecutive infeasible nodes before giving up
virtual void setupOther(CbcModel &model)
Other stuff e.g. strong branching and preprocessing.
virtual void setupCutGenerators(CbcModel &model)
Setup cut generators.
void setMaxInfeasible(int value)
maximum number of consecutive infeasible nodes before giving up
int pretendFailIsInfeasible_
If yes when a problem is not solved (failed to be solved) will pretend that it is infeasible...
virtual CbcNodeInfo * partialNodeInfo(CbcModel *model, CbcNodeInfo *parent, CbcNode *owner, int numberChangedBounds, const int *variables, const double *boundChanges, const CoinWarmStartDiff *basisDiff) const
Return a new Partial node information pointer (descendant of CbcPartialNodeInfo)
virtual CbcStrategy * clone() const
Clone.
CbcNlpStrategy & operator=(const CbcNlpStrategy &rhs)
Illegal Assignment operator.
bool hasFailed_
did we fail?
virtual void setupPrinting(CbcModel &model, int modelLogLevel)
Do printing stuff.
int maxFailure_
maximum number of consecutive failures in a branch before giving up
virtual void setupHeuristics(CbcModel &model)
Setup heuristics.
virtual int status(CbcModel *model, CbcNodeInfo *parent, int whereFrom)
After a CbcModel::resolve this can return a status -1 no effect 0 treat as optimal 1 as 0 but do not ...
CbcNlpStrategy(int maxFailures, int maxInfeasibles, int pretendFailIsInfeasible)