Blis 0.95.0
|
Heuristic base class. More...
#include <BlisHeuristic.h>
Public Member Functions | |
BlisHeuristic () | |
Default Constructor. | |
BlisHeuristic (BlisModel *model, const char *name, BlisHeurStrategy strategy, int heurCallFrequency) | |
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 (BlisHeurStrategy strategy) |
Get/set strategy. | |
virtual BlisHeurStrategy | strategy () const |
virtual void | setHeurCallFrequency (int freq) |
Get/set call frequency. | |
virtual int | heurCallFrequency () const |
virtual BlisHeuristic * | clone () const |
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 bool | 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 | |
const char * | name () const |
return name of generator. | |
void | addNumSolutions (int num=1) |
Record number of solutions found. | |
int | numSolutions () const |
Number of solutions found. | |
void | addTime (double t=0.0) |
Record Cpu time used. | |
double | time () const |
Cpu time used. | |
void | addCalls (int c=1) |
Record number of times called. | |
int | calls () const |
Number of times called. | |
int | noSolCalls () const |
Number called and no cons found. | |
void | addNoSolCalls (int n=1) |
Increase the number of no cons called. | |
Protected Attributes | |
BlisModel * | model_ |
Pointer to the model. | |
char * | name_ |
Heuristics name. | |
BlisHeurStrategy | strategy_ |
When to call findSolution() routine. | |
int | heurCallFrequency_ |
The frequency with which to call the heuristic. | |
int | numSolutions_ |
Number of solutions found. | |
double | time_ |
Used CPU/User time. | |
int | calls_ |
The times of calling this heuristic. | |
int | noSolsCalls_ |
The times of calling this heuristic and no solutions found. | |
Heuristic base class.
Definition at line 49 of file BlisHeuristic.h.
|
inline |
Default Constructor.
Definition at line 91 of file BlisHeuristic.h.
|
inline |
Useful constructor.
Definition at line 103 of file BlisHeuristic.h.
|
inlinevirtual |
Distructor.
Definition at line 121 of file BlisHeuristic.h.
|
inline |
Copy constructor.
Definition at line 124 of file BlisHeuristic.h.
|
inlinevirtual |
update model (This is needed if cliques update matrix etc).
Reimplemented in BlisHeurRound.
Definition at line 136 of file BlisHeuristic.h.
|
inlinevirtual |
Get/set strategy.
Definition at line 140 of file BlisHeuristic.h.
|
inlinevirtual |
Definition at line 141 of file BlisHeuristic.h.
|
inlinevirtual |
Get/set call frequency.
Definition at line 146 of file BlisHeuristic.h.
|
inlinevirtual |
Definition at line 147 of file BlisHeuristic.h.
|
inlinevirtual |
|
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.
|
inlinevirtual |
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 173 of file BlisHeuristic.h.
|
inline |
return name of generator.
Definition at line 178 of file BlisHeuristic.h.
|
inline |
Record number of solutions found.
Definition at line 181 of file BlisHeuristic.h.
|
inline |
Number of solutions found.
Definition at line 184 of file BlisHeuristic.h.
|
inline |
Record Cpu time used.
Definition at line 187 of file BlisHeuristic.h.
|
inline |
Cpu time used.
Definition at line 190 of file BlisHeuristic.h.
|
inline |
Record number of times called.
Definition at line 193 of file BlisHeuristic.h.
|
inline |
Number of times called.
Definition at line 196 of file BlisHeuristic.h.
|
inline |
Number called and no cons found.
Definition at line 199 of file BlisHeuristic.h.
|
inline |
Increase the number of no cons called.
Definition at line 202 of file BlisHeuristic.h.
|
protected |
Pointer to the model.
Definition at line 59 of file BlisHeuristic.h.
|
protected |
Heuristics name.
Definition at line 62 of file BlisHeuristic.h.
|
protected |
When to call findSolution() routine.
BlisHeurStrategyNone: disable BlisHeurStrategyRoot: just root BlisHeurStrategyAuto: automatically decided by BLIS BlisHeurStrategyPeriodic: every 't' nodes BlisHeurStrategyBeforeRoot: before solving first LP
Definition at line 71 of file BlisHeuristic.h.
|
protected |
The frequency with which to call the heuristic.
Definition at line 74 of file BlisHeuristic.h.
|
protected |
Number of solutions found.
Definition at line 77 of file BlisHeuristic.h.
|
protected |
Used CPU/User time.
Definition at line 80 of file BlisHeuristic.h.
|
protected |
The times of calling this heuristic.
Definition at line 83 of file BlisHeuristic.h.
|
protected |
The times of calling this heuristic and no solutions found.
Definition at line 86 of file BlisHeuristic.h.