source: trunk/Cbc/src/CbcHeuristicVND.hpp

Last change on this file was 2465, checked in by unxusr, 9 months ago

script to format sources

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1// $Id: CbcHeuristicVND.hpp 2465 2019-01-03 19:26:52Z stefan $
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
13/** LocalSearch class
14 */
15
16class CbcHeuristicVND : public CbcHeuristic {
17public:
18  // Default Constructor
19  CbcHeuristicVND();
20
21  /* Constructor with model - assumed before cuts
22       Initial version does not do Lps
23    */
24  CbcHeuristicVND(CbcModel &model);
25
26  // Copy constructor
27  CbcHeuristicVND(const CbcHeuristicVND &);
28
29  // Destructor
30  ~CbcHeuristicVND();
31
32  /// Clone
33  virtual CbcHeuristic *clone() const;
34
35  /// Assignment operator
36  CbcHeuristicVND &operator=(const CbcHeuristicVND &rhs);
37
38  /// Create C++ lines to get to current state
39  virtual void generateCpp(FILE *fp);
40
41  /// Resets stuff if model changes
42  virtual void resetModel(CbcModel *model);
43
44  /// update model (This is needed if cliques update matrix etc)
45  virtual void setModel(CbcModel *model);
46
47  using CbcHeuristic::solution;
48  /** returns 0 if no solution, 1 if valid solution.
49        Sets solution values if good, sets objective value (only if good)
50        This does Relaxation Induced Neighborhood Search
51    */
52  virtual int solution(double &objectiveValue,
53    double *newSolution);
54  /// This version fixes stuff and does IP
55  int solutionFix(double &objectiveValue,
56    double *newSolution,
57    const int *keep);
58
59  /// Sets how often to do it
60  inline void setHowOften(int value)
61  {
62    howOften_ = value;
63  }
64  /// base solution array so we can set
65  inline double *baseSolution() const
66  {
67    return baseSolution_;
68  }
69
70protected:
71  // Data
72
73  /// Number of solutions so we can do something at solution
74  int numberSolutions_;
75  /// How often to do (code can change)
76  int howOften_;
77  /// Number of successes
78  int numberSuccesses_;
79  /// Number of tries
80  int numberTries_;
81  /// Node when last done
82  int lastNode_;
83  /// Step size for decomposition
84  int stepSize_;
85  int k_;
86  int kmax_;
87  int nDifferent_;
88  /// Base solution
89  double *baseSolution_;
90};
91
92#endif
93
94/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
95*/
Note: See TracBrowser for help on using the repository browser.