Cbc  2.10.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CbcHeuristicVND.hpp
Go to the documentation of this file.
1 // $Id: CbcHeuristicVND.hpp 2465 2019-01-03 19:26:52Z unxusr $
2 // Copyright (C) 2006, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 // edwin 12/5/09 carved out of CbcHeuristicRINS
7 
8 #ifndef CbcHeuristicVND_H
9 #define CbcHeuristicVND_H
10 
11 #include "CbcHeuristic.hpp"
12 
16 class CbcHeuristicVND : public CbcHeuristic {
17 public:
18  // Default Constructor
20 
21  /* Constructor with model - assumed before cuts
22  Initial version does not do Lps
23  */
24  CbcHeuristicVND(CbcModel &model);
25 
26  // Copy constructor
28 
29  // Destructor
31 
33  virtual CbcHeuristic *clone() const;
34 
37 
39  virtual void generateCpp(FILE *fp);
40 
42  virtual void resetModel(CbcModel *model);
43 
45  virtual void setModel(CbcModel *model);
46 
52  virtual int solution(double &objectiveValue,
53  double *newSolution);
55  int solutionFix(double &objectiveValue,
56  double *newSolution,
57  const int *keep);
58 
60  inline void setHowOften(int value)
61  {
62  howOften_ = value;
63  }
65  inline double *baseSolution() const
66  {
67  return baseSolution_;
68  }
69 
70 protected:
71  // Data
72 
76  int howOften_;
82  int lastNode_;
84  int stepSize_;
85  int k_;
86  int kmax_;
89  double *baseSolution_;
90 };
91 
92 #endif
93 
94 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
95 */
LocalSearch class.
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution.
double * baseSolution() const
base solution array so we can set
int numberSuccesses_
Number of successes.
double * baseSolution_
Base solution.
virtual void setModel(CbcModel *model)
update model (This is needed if cliques update matrix etc)
int howOften_
How often to do (code can change)
int numberSolutions_
Number of solutions so we can do something at solution.
int numberTries_
Number of tries.
virtual CbcHeuristic * clone() const
Clone.
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
int lastNode_
Node when last done.
virtual void generateCpp(FILE *fp)
Create C++ lines to get to current state.
Heuristic base class.
virtual int solution(double &objectiveValue, double *newSolution)=0
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets sol...
int solutionFix(double &objectiveValue, double *newSolution, const int *keep)
This version fixes stuff and does IP.
CbcHeuristicVND & operator=(const CbcHeuristicVND &rhs)
Assignment operator.
Simple Branch and bound class.
Definition: CbcModel.hpp:100
int stepSize_
Step size for decomposition.
void setHowOften(int value)
Sets how often to do it.