Heuristic base class. More...
#include <BlisHeuristic.h>
Public Member Functions | |
BlisHeuristic () | |
Default Constructor. | |
BlisHeuristic (BlisModel *model, const char *name, int strategy) | |
Useful constructor. | |
virtual | ~BlisHeuristic () |
Distructor. | |
BlisHeuristic (const BlisHeuristic &rhs) | |
Copy constructor. | |
virtual void | setModel (BlisModel *model) |
update model (This is needed if cliques update matrix etc). | |
virtual void | setStrategy (int strategy) |
Get/set strategy. | |
virtual int | strategy () |
Get/set strategy. | |
virtual BlisHeuristic * | clone () const =0 |
Clone a heuristic. | |
virtual bool | searchSolution (double &objectiveValue, double *newSolution)=0 |
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets solution values if good, sets objective value This is called after cuts have been added - so can not add cuts | |
virtual int | searchSolution (double &objectiveValue, double *newSolution, OsiCuts &cs) |
returns 0 if no solution, 1 if valid solution, -1 if just returning an estimate of best possible solution with better objective value than one passed in Sets solution values if good, sets objective value (only if nonzero code) This is called at same time as cut generators - so can add cuts Default is do nothing | |
int | numSolutions () |
Number of solutions found. | |
double | time () |
Cpu time used. | |
int | calls () |
Cpu time used. | |
Protected Attributes | |
BlisModel * | model_ |
Pointer to the model. | |
char * | name_ |
Heuristics name. | |
int | strategy_ |
When to call findSolution() routine. | |
int | numSolutions_ |
Number of solutions found. | |
double | time_ |
Used CPU/User time. | |
int | calls_ |
The times of calling this heuristic. | |
Private Member Functions | |
BlisHeuristic & | operator= (const BlisHeuristic &rhs) |
Illegal Assignment operator. |
Heuristic base class.
Definition at line 46 of file BlisHeuristic.h.
BlisHeuristic::BlisHeuristic | ( | ) | [inline] |
Default Constructor.
Definition at line 81 of file BlisHeuristic.h.
BlisHeuristic::BlisHeuristic | ( | BlisModel * | model, | |
const char * | name, | |||
int | strategy | |||
) | [inline] |
Useful constructor.
Definition at line 91 of file BlisHeuristic.h.
virtual BlisHeuristic::~BlisHeuristic | ( | ) | [inline, virtual] |
Distructor.
Definition at line 106 of file BlisHeuristic.h.
BlisHeuristic::BlisHeuristic | ( | const BlisHeuristic & | rhs | ) | [inline] |
Copy constructor.
Definition at line 109 of file BlisHeuristic.h.
BlisHeuristic& BlisHeuristic::operator= | ( | const BlisHeuristic & | rhs | ) | [private] |
Illegal Assignment operator.
Reimplemented in BlisHeurRound.
virtual void BlisHeuristic::setModel | ( | BlisModel * | model | ) | [inline, virtual] |
update model (This is needed if cliques update matrix etc).
Reimplemented in BlisHeurRound.
Definition at line 119 of file BlisHeuristic.h.
virtual void BlisHeuristic::setStrategy | ( | int | strategy | ) | [inline, virtual] |
Get/set strategy.
Definition at line 123 of file BlisHeuristic.h.
virtual int BlisHeuristic::strategy | ( | ) | [inline, virtual] |
Get/set strategy.
Definition at line 124 of file BlisHeuristic.h.
virtual BlisHeuristic* BlisHeuristic::clone | ( | ) | const [pure virtual] |
Clone a heuristic.
Implemented in BlisHeurRound.
virtual bool BlisHeuristic::searchSolution | ( | double & | objectiveValue, | |
double * | newSolution | |||
) | [pure virtual] |
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets solution values if good, sets objective value This is called after cuts have been added - so can not add cuts
Implemented in BlisHeurRound.
virtual int BlisHeuristic::searchSolution | ( | double & | objectiveValue, | |
double * | newSolution, | |||
OsiCuts & | cs | |||
) | [inline, virtual] |
returns 0 if no solution, 1 if valid solution, -1 if just returning an estimate of best possible solution with better objective value than one passed in Sets solution values if good, sets objective value (only if nonzero code) This is called at same time as cut generators - so can add cuts Default is do nothing
Definition at line 146 of file BlisHeuristic.h.
int BlisHeuristic::numSolutions | ( | ) | [inline] |
Number of solutions found.
Definition at line 151 of file BlisHeuristic.h.
double BlisHeuristic::time | ( | ) | [inline] |
Cpu time used.
Definition at line 154 of file BlisHeuristic.h.
int BlisHeuristic::calls | ( | ) | [inline] |
Cpu time used.
Definition at line 157 of file BlisHeuristic.h.
BlisModel* BlisHeuristic::model_ [protected] |
Pointer to the model.
Definition at line 56 of file BlisHeuristic.h.
char* BlisHeuristic::name_ [protected] |
Heuristics name.
Definition at line 59 of file BlisHeuristic.h.
int BlisHeuristic::strategy_ [protected] |
When to call findSolution() routine.
-2: disable -1: just root 0: automatically decided by BLIS any positive integer: the node interval between the call
Definition at line 67 of file BlisHeuristic.h.
int BlisHeuristic::numSolutions_ [protected] |
Number of solutions found.
Definition at line 70 of file BlisHeuristic.h.
double BlisHeuristic::time_ [protected] |
Used CPU/User time.
Definition at line 73 of file BlisHeuristic.h.
int BlisHeuristic::calls_ [protected] |
The times of calling this heuristic.
Definition at line 76 of file BlisHeuristic.h.