#include <BlisHeuristic.h>
Inheritance diagram for BlisHeuristic:
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). | |
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 (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. | |
virtual void | setStrategy (BlisHeurStrategy strategy) |
Get/set strategy. | |
virtual BlisHeurStrategy | strategy () const |
Get/set strategy. | |
virtual void | setHeurCallFrequency (int freq) |
Get/set call frequency. | |
virtual int | heurCallFrequency () const |
Get/set strategy. | |
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. | |
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. | |
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 | noSolsCalls_ |
The times of calling this heuristic and no solutions found. | |
Private Member Functions | |
BlisHeuristic & | operator= (const BlisHeuristic &rhs) |
Illegal Assignment operator. | |
BlisHeuristic & | operator= (const BlisHeuristic &rhs) |
Illegal Assignment operator. |
Definition at line 47 of file BlisHeuristic.h.
BlisHeuristic::BlisHeuristic | ( | ) | [inline] |
Default Constructor.
Definition at line 82 of file BlisHeuristic.h.
References calls_, model_, name_, numSolutions_, strategy_, and time_.
BlisHeuristic::BlisHeuristic | ( | BlisModel * | model, | |
const char * | name, | |||
int | strategy | |||
) | [inline] |
Useful constructor.
Definition at line 92 of file BlisHeuristic.h.
References calls_, model_, name_, numSolutions_, strategy_, and time_.
virtual BlisHeuristic::~BlisHeuristic | ( | ) | [inline, virtual] |
BlisHeuristic::BlisHeuristic | ( | const BlisHeuristic & | rhs | ) | [inline] |
Copy constructor.
Definition at line 110 of file BlisHeuristic.h.
References calls_, model_, name_, numSolutions_, strategy_, and time_.
BlisHeuristic::BlisHeuristic | ( | ) | [inline] |
Default Constructor.
Definition at line 90 of file BlisHeuristic.h.
References BlisHeurStrategyAuto, calls_, heurCallFrequency_, model_, name_, noSolsCalls_, numSolutions_, strategy_, and time_.
BlisHeuristic::BlisHeuristic | ( | BlisModel * | model, | |
const char * | name, | |||
BlisHeurStrategy | strategy, | |||
int | heurCallFrequency | |||
) | [inline] |
Useful constructor.
Definition at line 102 of file BlisHeuristic.h.
References calls_, heurCallFrequency_, model_, name_, noSolsCalls_, numSolutions_, strategy_, and time_.
virtual BlisHeuristic::~BlisHeuristic | ( | ) | [inline, virtual] |
BlisHeuristic::BlisHeuristic | ( | const BlisHeuristic & | rhs | ) | [inline] |
Copy constructor.
Definition at line 123 of file BlisHeuristic.h.
References calls_, heurCallFrequency_, model_, name_, noSolsCalls_, numSolutions_, strategy_, and time_.
BlisHeuristic& BlisHeuristic::operator= | ( | const BlisHeuristic & | rhs | ) | [private] |
Illegal Assignment operator.
virtual void BlisHeuristic::setModel | ( | BlisModel * | model | ) | [inline, virtual] |
update model (This is needed if cliques update matrix etc).
Reimplemented in BlisHeurRound, and BlisHeurRound.
Definition at line 120 of file BlisHeuristic.h.
References model_.
virtual void BlisHeuristic::setStrategy | ( | int | strategy | ) | [inline, virtual] |
virtual int BlisHeuristic::strategy | ( | ) | [inline, virtual] |
virtual BlisHeuristic* BlisHeuristic::clone | ( | ) | const [pure virtual] |
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, VrpHeurTSP, and 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 147 of file BlisHeuristic.h.
int BlisHeuristic::numSolutions | ( | ) | [inline] |
Number of solutions found.
Definition at line 152 of file BlisHeuristic.h.
References numSolutions_.
double BlisHeuristic::time | ( | ) | [inline] |
int BlisHeuristic::calls | ( | ) | [inline] |
BlisHeuristic& BlisHeuristic::operator= | ( | const BlisHeuristic & | rhs | ) | [private] |
Illegal Assignment operator.
virtual void BlisHeuristic::setModel | ( | BlisModel * | model | ) | [inline, virtual] |
update model (This is needed if cliques update matrix etc).
Reimplemented in BlisHeurRound, and BlisHeurRound.
Definition at line 135 of file BlisHeuristic.h.
References model_.
virtual void BlisHeuristic::setStrategy | ( | BlisHeurStrategy | strategy | ) | [inline, virtual] |
virtual BlisHeurStrategy BlisHeuristic::strategy | ( | ) | const [inline, virtual] |
virtual void BlisHeuristic::setHeurCallFrequency | ( | int | freq | ) | [inline, virtual] |
Get/set call frequency.
Definition at line 145 of file BlisHeuristic.h.
References heurCallFrequency_.
virtual int BlisHeuristic::heurCallFrequency | ( | ) | const [inline, virtual] |
virtual BlisHeuristic* BlisHeuristic::clone | ( | ) | const [inline, virtual] |
Clone a heuristic.
Reimplemented in BlisHeurRound, and BlisHeurRound.
Definition at line 150 of file BlisHeuristic.h.
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, VrpHeurTSP, and BlisHeurRound.
virtual bool 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 172 of file BlisHeuristic.h.
const char* BlisHeuristic::name | ( | ) | const [inline] |
void BlisHeuristic::addNumSolutions | ( | int | num = 1 |
) | [inline] |
Record number of solutions found.
Definition at line 180 of file BlisHeuristic.h.
References numSolutions_.
int BlisHeuristic::numSolutions | ( | ) | const [inline] |
Number of solutions found.
Definition at line 183 of file BlisHeuristic.h.
References numSolutions_.
void BlisHeuristic::addTime | ( | double | t = 0.0 |
) | [inline] |
double BlisHeuristic::time | ( | ) | const [inline] |
void BlisHeuristic::addCalls | ( | int | c = 1 |
) | [inline] |
int BlisHeuristic::calls | ( | ) | const [inline] |
int BlisHeuristic::noSolCalls | ( | ) | const [inline] |
Number called and no cons found.
Definition at line 198 of file BlisHeuristic.h.
References noSolsCalls_.
void BlisHeuristic::addNoSolCalls | ( | int | n = 1 |
) | [inline] |
Increase the number of no cons called.
Definition at line 201 of file BlisHeuristic.h.
References noSolsCalls_.
BlisModel* BlisHeuristic::model_ [protected] |
Pointer to the model.
Definition at line 57 of file BlisHeuristic.h.
Referenced by BlisHeuristic(), and setModel().
char* BlisHeuristic::name_ [protected] |
Heuristics name.
Definition at line 60 of file BlisHeuristic.h.
Referenced by BlisHeuristic(), name(), and ~BlisHeuristic().
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 68 of file BlisHeuristic.h.
Referenced by BlisHeuristic(), setStrategy(), and strategy().
int BlisHeuristic::numSolutions_ [protected] |
Number of solutions found.
Definition at line 71 of file BlisHeuristic.h.
Referenced by addNumSolutions(), BlisHeuristic(), and numSolutions().
double BlisHeuristic::time_ [protected] |
Used CPU/User time.
Definition at line 74 of file BlisHeuristic.h.
Referenced by addTime(), BlisHeuristic(), and time().
int BlisHeuristic::calls_ [protected] |
The times of calling this heuristic.
Definition at line 77 of file BlisHeuristic.h.
Referenced by addCalls(), BlisHeuristic(), and calls().
BlisModel* BlisHeuristic::model_ [protected] |
char* BlisHeuristic::name_ [protected] |
BlisHeurStrategy BlisHeuristic::strategy_ [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 70 of file BlisHeuristic.h.
int BlisHeuristic::heurCallFrequency_ [protected] |
The frequency with which to call the heuristic.
Definition at line 73 of file BlisHeuristic.h.
Referenced by BlisHeuristic(), heurCallFrequency(), and setHeurCallFrequency().
int BlisHeuristic::noSolsCalls_ [protected] |
The times of calling this heuristic and no solutions found.
Definition at line 85 of file BlisHeuristic.h.
Referenced by addNoSolCalls(), BlisHeuristic(), and noSolCalls().