source: branches/devel/Cbc/src/CbcHeuristicRINS.hpp @ 592

Last change on this file since 592 was 502, checked in by forrest, 13 years ago

mostly for rins

File size: 1.9 KB
Line 
1// Copyright (C) 2006, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#ifndef CbcHeuristicRINS_H
4#define CbcHeuristicRINS_H
5
6#include "CbcHeuristic.hpp"
7/** LocalSearch class
8 */
9
10class CbcHeuristicRINS : public CbcHeuristic {
11public:
12
13  // Default Constructor
14  CbcHeuristicRINS ();
15
16  /* Constructor with model - assumed before cuts
17     Initial version does not do Lps
18  */
19  CbcHeuristicRINS (CbcModel & model);
20 
21  // Copy constructor
22  CbcHeuristicRINS ( const CbcHeuristicRINS &);
23   
24  // Destructor
25  ~CbcHeuristicRINS ();
26 
27  /// Clone
28  virtual CbcHeuristic * clone() const;
29
30
31  /// Assignment operator
32  CbcHeuristicRINS & operator=(const CbcHeuristicRINS& rhs);
33
34  /// Create C++ lines to get to current state
35  virtual void generateCpp( FILE * fp) ;
36
37  /// Resets stuff if model changes
38  virtual void resetModel(CbcModel * model);
39
40  /// update model (This is needed if cliques update matrix etc)
41  virtual void setModel(CbcModel * model);
42 
43  /** returns 0 if no solution, 1 if valid solution.
44      Sets solution values if good, sets objective value (only if good)
45      This does Relaxation Induced Neighborhood Search
46  */
47  virtual int solution(double & objectiveValue,
48                       double * newSolution);
49  /// This version fixes stuff and does IP
50  int solutionFix(double & objectiveValue,
51                  double * newSolution,
52                  const int * keep);
53
54  /// Sets how often to do it
55  inline void setHowOften(int value)
56  { howOften_=value;};
57  /// Used array so we can set
58  inline char * used() const
59  { return used_;};
60
61protected:
62  // Data
63
64  /// Number of solutions so we can do something at solution
65  int numberSolutions_;
66  /// How often to do (code can change)
67  int howOften_;
68  /// Number of successes
69  int numberSuccesses_;
70  /// Number of tries
71  int numberTries_;
72  /// Whether a variable has been in a solution
73  char * used_;
74};
75
76
77#endif
Note: See TracBrowser for help on using the repository browser.