| 1 |
// (C) Copyright CNRS and International Business Machines Corporation |
| 2 |
// All Rights Reserved. |
| 3 |
// This code is published under the Eclipse Public License. |
| 4 |
// |
| 5 |
// Authors : |
| 6 |
// Pierre Bonami, LIF Université de la Méditérannée-CNRS |
| 7 |
// Joao Goncalves, International Business Machines Corporation |
| 8 |
// |
| 9 |
// Date : 06/18/2008 |
| 10 |
|
| 11 |
#ifndef BonHeuristicLocalBranching_H |
| 12 |
#define BonHeuristicLocalBranching_H |
| 13 |
#include "BonLocalSolverBasedHeuristic.hpp" |
| 14 |
|
| 15 |
namespace Bonmin { |
| 16 |
class HeuristicLocalBranching:public LocalSolverBasedHeuristic { |
| 17 |
public: |
| 18 |
/** Default constructor*/ |
| 19 |
HeuristicLocalBranching(); |
| 20 |
/** Constructor with setup.*/ |
| 21 |
HeuristicLocalBranching(BonminSetup * setup); |
| 22 |
|
| 23 |
/** Copy constructor.*/ |
| 24 |
HeuristicLocalBranching(const HeuristicLocalBranching &other); |
| 25 |
/** Virtual constructor.*/ |
| 26 |
virtual CbcHeuristic * clone() const{ |
| 27 |
return new HeuristicLocalBranching(*this); |
| 28 |
} |
| 29 |
|
| 30 |
/** Destructor*/ |
| 31 |
virtual ~HeuristicLocalBranching(); |
| 32 |
|
| 33 |
/// Update model |
| 34 |
virtual void setModel(CbcModel * model); |
| 35 |
|
| 36 |
/// Validate model i.e. sets when_ to 0 if necessary |
| 37 |
virtual void validate(); |
| 38 |
|
| 39 |
/** Runs heuristic*/ |
| 40 |
int solution(double & objectiveValue, |
| 41 |
double * newSolution); |
| 42 |
|
| 43 |
/** Register the options common to all local search based heuristics.*/ |
| 44 |
static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions); |
| 45 |
|
| 46 |
/** Initiaize using passed options.*/ |
| 47 |
void Initialize(Ipopt::SmartPtr<Ipopt::OptionsList> options); |
| 48 |
|
| 49 |
private: |
| 50 |
/// How often to do (code can change) |
| 51 |
int howOften_; |
| 52 |
/// Number of solutions so we can do something at solution |
| 53 |
int numberSolutions_; |
| 54 |
|
| 55 |
}; |
| 56 |
|
| 57 |
}/* Ends Bonmin namepace.*/ |
| 58 |
#endif |
| 59 |
|