- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes | Private Member Functions | List of all members
BlisHeuristic Class Referenceabstract

Heuristic base class. More...

`#include <BlisHeuristic.h>`

Inheritance diagram for BlisHeuristic:
[legend]
Collaboration diagram for BlisHeuristic:
[legend]

## Public Member Functions
| BlisHeuristic ()
| Default Constructor. More...
| BlisHeuristic (BlisModel *model, const char *name, int strategy)
| Useful constructor. More...
virtual | ~BlisHeuristic ()
| Distructor. More...
| BlisHeuristic (const BlisHeuristic &rhs)
| Copy constructor. More...
virtual void | setModel (BlisModel *model)
| update model (This is needed if cliques update matrix etc). More...
| BlisHeuristic ()
| Default Constructor. More...
| BlisHeuristic (BlisModel *model, const char *name, BlisHeurStrategy strategy, int heurCallFrequency)
| Useful constructor. More...
virtual | ~BlisHeuristic ()
| Distructor. More...
| BlisHeuristic (const BlisHeuristic &rhs)
| Copy constructor. More...
virtual void | setModel (BlisModel *model)
| update model (This is needed if cliques update matrix etc). More...
virtual void | setStrategy (int strategy)
| Get/set strategy. More...
virtual int | strategy ()
| Get/set strategy. More...
virtual BlisHeuristic * | clone () const =0
| Clone a heuristic. More...
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 More...
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 More...
int | numSolutions ()
| Number of solutions found. More...
double | time ()
| Cpu time used. More...
int | calls ()
| Cpu time used. More...
virtual void | setStrategy (BlisHeurStrategy strategy)
| Get/set strategy. More...
virtual BlisHeurStrategy | strategy () const
| Get/set strategy. More...
virtual void | setHeurCallFrequency (int freq)
| Get/set call frequency. More...
virtual int | heurCallFrequency () const
| Get/set strategy. More...
virtual BlisHeuristic * | clone () const
| Clone a heuristic. More...
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 More...
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 More...
const char * | name () const
| return name of generator. More...
void | addNumSolutions (int num=1)
| Record number of solutions found. More...
int | numSolutions () const
| Number of solutions found. More...
void | addTime (double t=0.0)
| Record Cpu time used. More...
double | time () const
| Cpu time used. More...
void | addCalls (int c=1)
| Record number of times called. More...
int | calls () const
| Number of times called. More...
int | noSolCalls () const
| Number called and no cons found. More...
void | addNoSolCalls (int n=1)
| Increase the number of no cons called. More...

## Protected Attributes
BlisModel * | model_
| Pointer to the model. More...
char * | name_
| Heuristics name. More...
int | strategy_
| When to call findSolution() routine. More...
int | numSolutions_
| Number of solutions found. More...
double | time_
| Used CPU/User time. More...
int | calls_
| The times of calling this heuristic. More...
BlisHeurStrategy | strategy_
| When to call findSolution() routine. More...
int | heurCallFrequency_
| The frequency with which to call the heuristic. More...
int | noSolsCalls_
| The times of calling this heuristic and no solutions found. More...

## Private Member Functions
BlisHeuristic & | operator= (const BlisHeuristic &rhs)
| Illegal Assignment operator. More...
BlisHeuristic & | operator= (const BlisHeuristic &rhs)
| Illegal Assignment operator. More...

## Detailed Description

Heuristic base class.

Definition at line 46 of file BlisHeuristic.h.

## Constructor & Destructor Documentation

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 | ( |  | ) |
| inline

Default Constructor.

Definition at line 90 of file BlisHeuristic.h.

BlisHeuristic::BlisHeuristic | ( | BlisModel * | model,
|  | const char * | name,
|  | BlisHeurStrategy | strategy,
|  | int | heurCallFrequency
| ) |  |
| inline

Useful constructor.

Definition at line 102 of file BlisHeuristic.h.

virtual BlisHeuristic::~BlisHeuristic | ( |  | ) |
| inline virtual

Distructor.

Definition at line 120 of file BlisHeuristic.h.

BlisHeuristic::BlisHeuristic | ( | const BlisHeuristic & | rhs | ) |
| inline

Copy constructor.

Definition at line 123 of file BlisHeuristic.h.

## Member Function Documentation

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 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, and 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 VrpHeurTSP, BlisHeurRound, 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 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.

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.

virtual void BlisHeuristic::setStrategy | ( | BlisHeurStrategy | strategy | ) |
| inline virtual

Get/set strategy.

Definition at line 139 of file BlisHeuristic.h.

virtual BlisHeurStrategy BlisHeuristic::strategy | ( |  | ) | const
| inline virtual

Get/set strategy.

Definition at line 140 of file BlisHeuristic.h.

virtual void BlisHeuristic::setHeurCallFrequency | ( | int | freq | ) |
| inline virtual

Get/set call frequency.

Definition at line 145 of file BlisHeuristic.h.

virtual int BlisHeuristic::heurCallFrequency | ( |  | ) | const
| inline virtual

Get/set strategy.

Definition at line 146 of file BlisHeuristic.h.

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 VrpHeurTSP, BlisHeurRound, 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

return name of generator.

Definition at line 177 of file BlisHeuristic.h.

void BlisHeuristic::addNumSolutions | ( | int | num = `1` | ) |
| inline

Record number of solutions found.

Definition at line 180 of file BlisHeuristic.h.

int BlisHeuristic::numSolutions | ( |  | ) | const
| inline

Number of solutions found.

Definition at line 183 of file BlisHeuristic.h.

void BlisHeuristic::addTime | ( | double | t = `0.0` | ) |
| inline

Record Cpu time used.

Definition at line 186 of file BlisHeuristic.h.

double BlisHeuristic::time | ( |  | ) | const
| inline

Cpu time used.

Definition at line 189 of file BlisHeuristic.h.

void BlisHeuristic::addCalls | ( | int | c = `1` | ) |
| inline

Record number of times called.

Definition at line 192 of file BlisHeuristic.h.

int BlisHeuristic::calls | ( |  | ) | const
| inline

Number of times called.

Definition at line 195 of file BlisHeuristic.h.

int BlisHeuristic::noSolCalls | ( |  | ) | const
| inline

Number called and no cons found.

Definition at line 198 of file BlisHeuristic.h.

void BlisHeuristic::addNoSolCalls | ( | int | n = `1` | ) |
| inline

Increase the number of no cons called.

Definition at line 201 of file BlisHeuristic.h.

## Member Data Documentation

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.

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.

int BlisHeuristic::noSolsCalls_
| protected

The times of calling this heuristic and no solutions found.

Definition at line 85 of file BlisHeuristic.h.

The documentation for this class was generated from the following files:

- /tmp/CHiPPS-Blis-0.94.3/Bcps/examples/Blis/BlisHeuristic.h
- /tmp/CHiPPS-Blis-0.94.3/Blis/src/BlisHeuristic.h