source: trunk/Bonmin/src/CbcBonmin/BonminCbcNlpStrategy.hpp @ 1

Last change on this file since 1 was 1, checked in by andreasw, 13 years ago

imported initial code

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 2.8 KB
Line 
1// (C) Copyright International Business Machines Corporation and Carnegie Mellon University 2006
2// All Rights Reserved.
3// This code is published under the Common 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 BonminCbcNlpStrategy_H
12#define BonminCbcNlpStrategy_H
13
14#include "CbcStrategy.hpp"
15class CglPreProcess;
16class CbcNodeInfo;
17class CbcNode;
18class CoinWarmStartDiff;
19
20class BonminCbcNlpStrategy : public CbcStrategy
21{
22public:
23
24  // Default Constructor
25  BonminCbcNlpStrategy (int maxFailures,
26      int maxInfeasibles,
27      int pretendFailIsInfeasible);
28
29  // Copy constructor
30  BonminCbcNlpStrategy ( const BonminCbcNlpStrategy &);
31
32  // Destructor
33  virtual ~BonminCbcNlpStrategy ();
34
35  /// Clone
36  virtual CbcStrategy * clone() const;
37
38  /// Return a new Full node information pointer (descendant of CbcFullNodeInfo)
39  virtual CbcNodeInfo * fullNodeInfo(CbcModel * model,int numberRowsAtContinuous) const;
40  /// Return a new Partial node information pointer (descendant of CbcPartialNodeInfo)
41  virtual CbcNodeInfo * partialNodeInfo(CbcModel * model, CbcNodeInfo * parent, CbcNode * owner,
42      int numberChangedBounds,const int * variables,
43      const double * boundChanges,
44      const CoinWarmStartDiff *basisDiff) const;
45  /** After a CbcModel::resolve this can return a status
46      -1 no effect
47      0 treat as optimal
48      1 as 0 but do not do any more resolves (i.e. no more cuts)
49      2 treat as infeasible
50  */
51  virtual int status(CbcModel * model, CbcNodeInfo * parent, int whereFrom);
52  /// set maximum number of consecutive failures in a branch before giving up
53  inline void setMaxFailure(int value)
54  {
55    maxFailure_ = value;
56  }
57  /// maximum number of consecutive infeasible nodes before giving up
58  inline void setMaxInfeasible(int value)
59  {
60    maxInfeasible_ = value;
61  }
62
63  /// Setup cut generators
64  virtual void setupCutGenerators(CbcModel & model);
65  /// Setup heuristics
66  virtual void setupHeuristics(CbcModel & model);
67  /// Do printing stuff
68  virtual void setupPrinting(CbcModel & model,int modelLogLevel);
69  /// Other stuff e.g. strong branching and preprocessing
70  virtual void setupOther(CbcModel & model);
71
72  bool hasFailed()
73  {
74    return hasFailed_;
75  }
76protected:
77  // Data
78  /// did we fail?
79  bool hasFailed_;
80  /// maximum number of consecutive failures in a branch before giving up
81  int maxFailure_;
82  /// maximum number of consecutive infeasible nodes before giving up
83  int maxInfeasible_;
84  /** If yes when a problem is not solved (failed to be solved)
85      will pretend that it is infeasible. */
86  int pretendFailIsInfeasible_;
87
88private:
89  /// Illegal Assignment operator
90  BonminCbcNlpStrategy & operator=(const BonminCbcNlpStrategy& rhs);
91
92};
93
94
95#endif
Note: See TracBrowser for help on using the repository browser.