Blis  0.94.0
Protected Attributes | List of all members
BlisConGenerator Class Reference

Interface between Blis and Cut Generation Library. More...

#include <BlisConGenerator.h>

Public Member Functions

Constructors and destructors
 BlisConGenerator ()
 Default constructor. More...
 
 BlisConGenerator (BlisModel *model, CglCutGenerator *generator, const char *name=NULL, BlisCutStrategy strategy=BlisCutStrategyAuto, int cutGenerationFrequency_=1, bool normal=true, bool atSolution=false, bool infeasible=false)
 Useful constructor. More...
 
 BlisConGenerator (const BlisConGenerator &)
 Copy constructor. More...
 
BlisConGeneratoroperator= (const BlisConGenerator &rhs)
 Assignment operator. More...
 
virtual ~BlisConGenerator ()
 Destructor. More...
 
Generate Constraints
virtual bool generateConstraints (BcpsConstraintPool &conPool)
 Generate cons for the client model. More...
 
Gets and sets
BlisModelgetModel ()
 Set the client model. More...
 
void setModel (BlisModel *m)
 Set the model. More...
 
void refreshModel (BlisModel *model)
 Refresh the model. More...
 
void setName (const char *str)
 return name of generator. More...
 
std::string name () const
 return name of generator. More...
 
void setStrategy (BlisCutStrategy value)
 Set the con generation strategy. More...
 
BlisCutStrategy strategy () const
 Get the con generation interval. More...
 
void setCutGenerationFreq (int freq)
 Set the con generation strategy. More...
 
int cutGenerationFreq () const
 Get the con generation interval. More...
 
bool normal () const
 Get whether the con generator should be called in the normal place. More...
 
void setNormal (bool value)
 Set whether the con generator should be called in the normal place. More...
 
bool atSolution () const
 Get whether the con generator should be called when a solution is found. More...
 
void setAtSolution (bool value)
 Set whether the con generator should be called when a solution is found. More...
 
bool whenInfeasible () const
 Get whether the con generator should be called when the subproblem is found to be infeasible. More...
 
void setWhenInfeasible (bool value)
 Set whether the con generator should be called when the subproblem is found to be infeasible. More...
 
CglCutGenerator * generator () const
 Get the CglCutGenerator bound to this BlisConGenerator. More...
 
int numConsGenerated ()
 Get number of generated cons. More...
 
void addNumConsGenerated (int n)
 Increase the number of generated cons. More...
 
int numConsUsed ()
 Get number of used cons. More...
 
void addNumConsUsed (int n)
 Increase the number of generated cons. More...
 
double time () const
 Cpu time used. More...
 
void addTime (double t)
 Increase Cpu time used. More...
 
int calls () const
 Number called. More...
 
void addCalls (int n=1)
 Increase the number of called. More...
 
int noConsCalls () const
 Number called and no cons found. More...
 
void addNoConsCalls (int n=1)
 Increase the number of no cons called. More...
 

Protected Attributes

BlisModelmodel_
 The client model. More...
 
CglCutGenerator * generator_
 The CglCutGenerator object. More...
 
BlisCutStrategy strategy_
 When to call CglCutGenerator::generateCuts routine. More...
 
int cutGenerationFrequency_
 The frequency of calls to the cut generator. More...
 
std::string name_
 Name of generator. More...
 
bool normal_
 Whether to call the generator in the normal place. More...
 
bool atSolution_
 Whether to call the generator when a new solution is found. More...
 
bool whenInfeasible_
 Whether to call generator when a subproblem is found to be infeasible. More...
 
int numConsGenerated_
 Number of cons generated. More...
 
int numConsUsed_
 Number of cons used. More...
 
double time_
 Used CPU/User time. More...
 
int calls_
 The times of calling this generator. More...
 
int noConsCalls_
 The times of calling this generator and no cons found. More...
 

Detailed Description

Interface between Blis and Cut Generation Library.

BlisConGenerator is intended to provide an intelligent interface between Blis and the cutting plane algorithms in the CGL. A BlisConGenerator is bound to a CglCutGenerator and to an BlisModel. It contains parameters which control when and how the generateCuts method of the CglCutGenerator will be called.

The builtin decision criteria available to use when deciding whether to generate cons are: at root, autmatic, every X nodes, when a solution is found, and when a subproblem is found to be infeasible.

Definition at line 58 of file BlisConGenerator.h.

Constructor & Destructor Documentation

BlisConGenerator::BlisConGenerator ( )
inline

Default constructor.

Definition at line 119 of file BlisConGenerator.h.

BlisConGenerator::BlisConGenerator ( BlisModel model,
CglCutGenerator *  generator,
const char *  name = NULL,
BlisCutStrategy  strategy = BlisCutStrategyAuto,
int  cutGenerationFrequency_ = 1,
bool  normal = true,
bool  atSolution = false,
bool  infeasible = false 
)

Useful constructor.

BlisConGenerator::BlisConGenerator ( const BlisConGenerator )

Copy constructor.

virtual BlisConGenerator::~BlisConGenerator ( )
inlinevirtual

Destructor.

Definition at line 152 of file BlisConGenerator.h.

Member Function Documentation

BlisConGenerator& BlisConGenerator::operator= ( const BlisConGenerator rhs)

Assignment operator.

virtual bool BlisConGenerator::generateConstraints ( BcpsConstraintPool &  conPool)
virtual

Generate cons for the client model.

Evaluate the state of the client model and decide whether to generate cons. The generated cons are inserted into and returned in the collection of cons cs.

The routine returns true if reoptimisation is needed (because the state of the solver interface has been modified).

BlisModel* BlisConGenerator::getModel ( )
inline

Set the client model.

In addition to setting the client model, refreshModel also calls the refreshSolver method of the CglCutGenerator object.Get a pointer to the model

Definition at line 182 of file BlisConGenerator.h.

void BlisConGenerator::setModel ( BlisModel m)
inline

Set the model.

Definition at line 185 of file BlisConGenerator.h.

void BlisConGenerator::refreshModel ( BlisModel model)

Refresh the model.

void BlisConGenerator::setName ( const char *  str)
inline

return name of generator.

Definition at line 191 of file BlisConGenerator.h.

std::string BlisConGenerator::name ( ) const
inline

return name of generator.

Definition at line 194 of file BlisConGenerator.h.

void BlisConGenerator::setStrategy ( BlisCutStrategy  value)
inline

Set the con generation strategy.

Definition at line 197 of file BlisConGenerator.h.

BlisCutStrategy BlisConGenerator::strategy ( ) const
inline

Get the con generation interval.

Definition at line 200 of file BlisConGenerator.h.

void BlisConGenerator::setCutGenerationFreq ( int  freq)
inline

Set the con generation strategy.

Definition at line 203 of file BlisConGenerator.h.

int BlisConGenerator::cutGenerationFreq ( ) const
inline

Get the con generation interval.

Definition at line 206 of file BlisConGenerator.h.

bool BlisConGenerator::normal ( ) const
inline

Get whether the con generator should be called in the normal place.

Definition at line 209 of file BlisConGenerator.h.

void BlisConGenerator::setNormal ( bool  value)
inline

Set whether the con generator should be called in the normal place.

Definition at line 212 of file BlisConGenerator.h.

bool BlisConGenerator::atSolution ( ) const
inline

Get whether the con generator should be called when a solution is found.

Definition at line 216 of file BlisConGenerator.h.

void BlisConGenerator::setAtSolution ( bool  value)
inline

Set whether the con generator should be called when a solution is found.

Definition at line 220 of file BlisConGenerator.h.

bool BlisConGenerator::whenInfeasible ( ) const
inline

Get whether the con generator should be called when the subproblem is found to be infeasible.

Definition at line 224 of file BlisConGenerator.h.

void BlisConGenerator::setWhenInfeasible ( bool  value)
inline

Set whether the con generator should be called when the subproblem is found to be infeasible.

Definition at line 228 of file BlisConGenerator.h.

CglCutGenerator* BlisConGenerator::generator ( ) const
inline

Get the CglCutGenerator bound to this BlisConGenerator.

Definition at line 231 of file BlisConGenerator.h.

int BlisConGenerator::numConsGenerated ( )
inline

Get number of generated cons.

Definition at line 234 of file BlisConGenerator.h.

void BlisConGenerator::addNumConsGenerated ( int  n)
inline

Increase the number of generated cons.

Definition at line 237 of file BlisConGenerator.h.

int BlisConGenerator::numConsUsed ( )
inline

Get number of used cons.

Definition at line 240 of file BlisConGenerator.h.

void BlisConGenerator::addNumConsUsed ( int  n)
inline

Increase the number of generated cons.

Definition at line 243 of file BlisConGenerator.h.

double BlisConGenerator::time ( ) const
inline

Cpu time used.

Definition at line 246 of file BlisConGenerator.h.

void BlisConGenerator::addTime ( double  t)
inline

Increase Cpu time used.

Definition at line 249 of file BlisConGenerator.h.

int BlisConGenerator::calls ( ) const
inline

Number called.

Definition at line 252 of file BlisConGenerator.h.

void BlisConGenerator::addCalls ( int  n = 1)
inline

Increase the number of called.

Definition at line 255 of file BlisConGenerator.h.

int BlisConGenerator::noConsCalls ( ) const
inline

Number called and no cons found.

Definition at line 258 of file BlisConGenerator.h.

void BlisConGenerator::addNoConsCalls ( int  n = 1)
inline

Increase the number of no cons called.

Definition at line 261 of file BlisConGenerator.h.

Member Data Documentation

BlisModel* BlisConGenerator::model_
protected

The client model.

Definition at line 62 of file BlisConGenerator.h.

CglCutGenerator* BlisConGenerator::generator_
protected

The CglCutGenerator object.

Definition at line 65 of file BlisConGenerator.h.

BlisCutStrategy BlisConGenerator::strategy_
protected

When to call CglCutGenerator::generateCuts routine.

BlisCutStrategyNone: disable BlisCutStrategyRoot: just root BlisCutStrategyAuto: automatically decided by BLIS BlisCutStrategyPeriodic: Generate every 't' nodes

Definition at line 77 of file BlisConGenerator.h.

int BlisConGenerator::cutGenerationFrequency_
protected

The frequency of calls to the cut generator.

Definition at line 80 of file BlisConGenerator.h.

std::string BlisConGenerator::name_
protected

Name of generator.

Definition at line 83 of file BlisConGenerator.h.

bool BlisConGenerator::normal_
protected

Whether to call the generator in the normal place.

Definition at line 86 of file BlisConGenerator.h.

bool BlisConGenerator::atSolution_
protected

Whether to call the generator when a new solution is found.

Definition at line 89 of file BlisConGenerator.h.

bool BlisConGenerator::whenInfeasible_
protected

Whether to call generator when a subproblem is found to be infeasible.

Definition at line 93 of file BlisConGenerator.h.

int BlisConGenerator::numConsGenerated_
protected

Number of cons generated.

Definition at line 100 of file BlisConGenerator.h.

int BlisConGenerator::numConsUsed_
protected

Number of cons used.

Definition at line 103 of file BlisConGenerator.h.

double BlisConGenerator::time_
protected

Used CPU/User time.

Definition at line 106 of file BlisConGenerator.h.

int BlisConGenerator::calls_
protected

The times of calling this generator.

Definition at line 109 of file BlisConGenerator.h.

int BlisConGenerator::noConsCalls_
protected

The times of calling this generator and no cons found.

Definition at line 112 of file BlisConGenerator.h.


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