source: stable/2.8/Cbc/src/CbcHeuristicRINS.hpp @ 1856

Last change on this file since 1856 was 1854, checked in by stefan, 7 years ago

fix svn keywords property

  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/* $Id: CbcHeuristicRINS.hpp 1854 2013-01-28 00:02:55Z 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#ifndef CbcHeuristicRINS_H
7#define CbcHeuristicRINS_H
8
9#include "CbcHeuristic.hpp"
10// for backward compatibility include 3 other headers
11#include "CbcHeuristicRENS.hpp"
12#include "CbcHeuristicDINS.hpp"
13#include "CbcHeuristicVND.hpp"
14/** LocalSearch class
15 */
16
17class CbcHeuristicRINS : public CbcHeuristic {
18public:
19
20    // Default Constructor
21    CbcHeuristicRINS ();
22
23    /* Constructor with model - assumed before cuts
24       Initial version does not do Lps
25    */
26    CbcHeuristicRINS (CbcModel & model);
27
28    // Copy constructor
29    CbcHeuristicRINS ( const CbcHeuristicRINS &);
30
31    // Destructor
32    ~CbcHeuristicRINS ();
33
34    /// Clone
35    virtual CbcHeuristic * clone() const;
36
37
38    /// Assignment operator
39    CbcHeuristicRINS & operator=(const CbcHeuristicRINS& rhs);
40
41    /// Create C++ lines to get to current state
42    virtual void generateCpp( FILE * fp) ;
43
44    /// Resets stuff if model changes
45    virtual void resetModel(CbcModel * model);
46
47    /// update model (This is needed if cliques update matrix etc)
48    virtual void setModel(CbcModel * model);
49
50    using CbcHeuristic::solution ;
51    /** returns 0 if no solution, 1 if valid solution.
52        Sets solution values if good, sets objective value (only if good)
53        This does Relaxation Induced Neighborhood Search
54    */
55    virtual int solution(double & objectiveValue,
56                         double * newSolution);
57    /// This version fixes stuff and does IP
58    int solutionFix(double & objectiveValue,
59                    double * newSolution,
60                    const int * keep);
61
62    /// Sets how often to do it
63    inline void setHowOften(int value) {
64        howOften_ = value;
65    }
66    /// Used array so we can set
67    inline char * used() const {
68        return used_;
69    }
70    /// Resets lastNode
71    inline void setLastNode(int value) {
72        lastNode_ = value;
73    }
74
75protected:
76    // Data
77
78    /// Number of solutions so we can do something at solution
79    int numberSolutions_;
80    /// How often to do (code can change)
81    int howOften_;
82    /// Number of successes
83    int numberSuccesses_;
84    /// Number of tries
85    int numberTries_;
86    /** State of fixing continuous variables -
87        0 - not tried
88        +n - this divisor makes small enough
89        -n - this divisor still not small enough
90    */
91    int stateOfFixing_;
92    /// Node when last done
93    int lastNode_;
94    /// Whether a variable has been in a solution
95    char * used_;
96};
97#endif
98
Note: See TracBrowser for help on using the repository browser.