Dip
0.92.4
|
Interface between Abc and Cut Generation Library. More...
#include <AbcCutGenerator.h>
Public Member Functions | |
Generate Cuts | |
bool | generateCuts (OsiCuts &cs, bool fullScan) |
Generate cuts for the client model. More... | |
bool | generateCuts (OsiCuts &cs, bool fullScan) |
Generate cuts for the client model. More... | |
Constructors and destructors | |
AbcCutGenerator () | |
Default constructor. More... | |
AbcCutGenerator (AbcModel *model, CglCutGenerator *generator, int howOften=1, const char *name=NULL, bool normal=true, bool atSolution=false, bool infeasible=false) | |
Normal constructor. More... | |
AbcCutGenerator (const AbcCutGenerator &) | |
Copy constructor. More... | |
AbcCutGenerator & | operator= (const AbcCutGenerator &rhs) |
Assignment operator. More... | |
~AbcCutGenerator () | |
Destructor. More... | |
AbcCutGenerator () | |
Default constructor. More... | |
AbcCutGenerator (AbcModel *model, CglCutGenerator *generator, int howOften=1, const char *name=NULL, bool normal=true, bool atSolution=false, bool infeasible=false) | |
Normal constructor. More... | |
AbcCutGenerator (const AbcCutGenerator &) | |
Copy constructor. More... | |
AbcCutGenerator & | operator= (const AbcCutGenerator &rhs) |
Assignment operator. More... | |
~AbcCutGenerator () | |
Destructor. More... | |
Gets and sets | |
void | refreshModel (AbcModel *model) |
Set the client model. More... | |
const char * | cutGeneratorName () const |
return name of generator More... | |
void | setHowOften (int value) |
Set the cut generation interval. More... | |
int | howOften () const |
Get the cut generation interval. More... | |
bool | normal () const |
Get whether the cut generator should be called in the normal place. More... | |
void | setNormal (bool value) |
Set whether the cut generator should be called in the normal place. More... | |
bool | atSolution () const |
Get whether the cut generator should be called when a solution is found. More... | |
void | setAtSolution (bool value) |
Set whether the cut generator should be called when a solution is found. More... | |
bool | whenInfeasible () const |
Get whether the cut generator should be called when the subproblem is found to be infeasible. More... | |
void | setWhenInfeasible (bool value) |
Set whether the cut generator should be called when the subproblem is found to be infeasible. More... | |
CglCutGenerator * | generator () const |
Get the CglCutGenerator bound to this AbcCutGenerator . More... | |
void | refreshModel (AbcModel *model) |
Set the client model. More... | |
const char * | cutGeneratorName () const |
return name of generator More... | |
void | setHowOften (int value) |
Set the cut generation interval. More... | |
int | howOften () const |
Get the cut generation interval. More... | |
bool | normal () const |
Get whether the cut generator should be called in the normal place. More... | |
void | setNormal (bool value) |
Set whether the cut generator should be called in the normal place. More... | |
bool | atSolution () const |
Get whether the cut generator should be called when a solution is found. More... | |
void | setAtSolution (bool value) |
Set whether the cut generator should be called when a solution is found. More... | |
bool | whenInfeasible () const |
Get whether the cut generator should be called when the subproblem is found to be infeasible. More... | |
void | setWhenInfeasible (bool value) |
Set whether the cut generator should be called when the subproblem is found to be infeasible. More... | |
CglCutGenerator * | generator () const |
Get the CglCutGenerator bound to this AbcCutGenerator . More... | |
Private Attributes | |
AbcModel * | model_ |
The client model. More... | |
CglCutGenerator * | generator_ |
int | whenCutGenerator_ |
Number of nodes between calls to the CglCutGenerator::generateCuts routine. More... | |
char * | generatorName_ |
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... | |
Interface between Abc and Cut Generation Library.
AbcCutGenerator
is intended to provide an intelligent interface between Abc and the cutting plane algorithms in the CGL. A AbcCutGenerator
is bound to a CglCutGenerator
and to an AbcModel
. 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 cuts are limited: every X nodes, when a solution is found, and when a subproblem is found to be infeasible. The idea is that the class will grow more intelligent with time.
generateCuts
method. Create a default decision method that looks at the builtin criteria.AbcCutGenerator
is intended to provide an intelligent interface between Abc and the cutting plane algorithms in the CGL. A AbcCutGenerator
is bound to a CglCutGenerator
and to an AbcModel
. 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 cuts are limited: every X nodes, when a solution is found, and when a subproblem is found to be infeasible. The idea is that the class will grow more intelligent with time.
generateCuts
method. Create a default decision method that looks at the builtin criteria.Definition at line 69 of file AbcCutGenerator.h.
AbcCutGenerator::AbcCutGenerator | ( | ) |
Default constructor.
AbcCutGenerator::AbcCutGenerator | ( | AbcModel * | model, |
CglCutGenerator * | generator, | ||
int | howOften = 1 , |
||
const char * | name = NULL , |
||
bool | normal = true , |
||
bool | atSolution = false , |
||
bool | infeasible = false |
||
) |
Normal constructor.
AbcCutGenerator::AbcCutGenerator | ( | const AbcCutGenerator & | ) |
Copy constructor.
AbcCutGenerator::~AbcCutGenerator | ( | ) |
Destructor.
AbcCutGenerator::AbcCutGenerator | ( | ) |
Default constructor.
AbcCutGenerator::AbcCutGenerator | ( | AbcModel * | model, |
CglCutGenerator * | generator, | ||
int | howOften = 1 , |
||
const char * | name = NULL , |
||
bool | normal = true , |
||
bool | atSolution = false , |
||
bool | infeasible = false |
||
) |
Normal constructor.
AbcCutGenerator::AbcCutGenerator | ( | const AbcCutGenerator & | ) |
Copy constructor.
AbcCutGenerator::~AbcCutGenerator | ( | ) |
Destructor.
bool AbcCutGenerator::generateCuts | ( | OsiCuts & | cs, |
bool | fullScan | ||
) |
Generate cuts for the client model.
Evaluate the state of the client model and decide whether to generate cuts. The generated cuts are inserted into and returned in the collection of cuts cs
.
If fullScan
is true, the generator is obliged to call the CGL generateCuts
routine. Otherwise, it is free to make a local decision. The current implementation uses whenCutGenerator_
to decide.
The routine returns true if reoptimisation is needed (because the state of the solver interface has been modified).
AbcCutGenerator& AbcCutGenerator::operator= | ( | const AbcCutGenerator & | rhs | ) |
Assignment operator.
void AbcCutGenerator::refreshModel | ( | AbcModel * | model | ) |
Set the client model.
In addition to setting the client model, refreshModel also calls the refreshSolver
method of the CglCutGenerator object.
|
inline |
return name of generator
Definition at line 124 of file AbcCutGenerator.h.
References generatorName_.
void AbcCutGenerator::setHowOften | ( | int | value | ) |
Set the cut generation interval.
Set the number of nodes evaluated between calls to the Cgl object's generateCuts
routine.
If value
is positive, cuts will always be generated at the specified interval. If value
is negative, cuts will initially be generated at the specified interval, but Abc may adjust the value depending on the success of cuts produced by this generator.
A value of -100 disables the generator, while a value of -99 means just at root.
|
inline |
Get the cut generation interval.
Definition at line 146 of file AbcCutGenerator.h.
References whenCutGenerator_.
|
inline |
Get whether the cut generator should be called in the normal place.
Definition at line 150 of file AbcCutGenerator.h.
References normal_.
|
inline |
Set whether the cut generator should be called in the normal place.
Definition at line 153 of file AbcCutGenerator.h.
References normal_.
|
inline |
Get whether the cut generator should be called when a solution is found.
Definition at line 156 of file AbcCutGenerator.h.
References atSolution_.
|
inline |
Set whether the cut generator should be called when a solution is found.
Definition at line 159 of file AbcCutGenerator.h.
References atSolution_.
|
inline |
Get whether the cut generator should be called when the subproblem is
found to be infeasible.
Definition at line 164 of file AbcCutGenerator.h.
References whenInfeasible_.
|
inline |
Set whether the cut generator should be called when the subproblem is
found to be infeasible.
Definition at line 169 of file AbcCutGenerator.h.
References whenInfeasible_.
|
inline |
Get the CglCutGenerator
bound to this AbcCutGenerator
.
Definition at line 172 of file AbcCutGenerator.h.
References generator_.
bool AbcCutGenerator::generateCuts | ( | OsiCuts & | cs, |
bool | fullScan | ||
) |
Generate cuts for the client model.
Evaluate the state of the client model and decide whether to generate cuts. The generated cuts are inserted into and returned in the collection of cuts cs
.
If fullScan
is true, the generator is obliged to call the CGL generateCuts
routine. Otherwise, it is free to make a local decision. The current implementation uses whenCutGenerator_
to decide.
The routine returns true if reoptimisation is needed (because the state of the solver interface has been modified).
AbcCutGenerator& AbcCutGenerator::operator= | ( | const AbcCutGenerator & | rhs | ) |
Assignment operator.
void AbcCutGenerator::refreshModel | ( | AbcModel * | model | ) |
Set the client model.
In addition to setting the client model, refreshModel also calls the refreshSolver
method of the CglCutGenerator object.
|
inline |
return name of generator
Definition at line 124 of file AbcCutGenerator.h.
References generatorName_.
void AbcCutGenerator::setHowOften | ( | int | value | ) |
Set the cut generation interval.
Set the number of nodes evaluated between calls to the Cgl object's generateCuts
routine.
If value
is positive, cuts will always be generated at the specified interval. If value
is negative, cuts will initially be generated at the specified interval, but Abc may adjust the value depending on the success of cuts produced by this generator.
A value of -100 disables the generator, while a value of -99 means just at root.
|
inline |
Get the cut generation interval.
Definition at line 146 of file AbcCutGenerator.h.
References whenCutGenerator_.
|
inline |
Get whether the cut generator should be called in the normal place.
Definition at line 150 of file AbcCutGenerator.h.
References normal_.
|
inline |
Set whether the cut generator should be called in the normal place.
Definition at line 153 of file AbcCutGenerator.h.
References normal_.
|
inline |
Get whether the cut generator should be called when a solution is found.
Definition at line 156 of file AbcCutGenerator.h.
References atSolution_.
|
inline |
Set whether the cut generator should be called when a solution is found.
Definition at line 159 of file AbcCutGenerator.h.
References atSolution_.
|
inline |
Get whether the cut generator should be called when the subproblem is
found to be infeasible.
Definition at line 164 of file AbcCutGenerator.h.
References whenInfeasible_.
|
inline |
Set whether the cut generator should be called when the subproblem is
found to be infeasible.
Definition at line 169 of file AbcCutGenerator.h.
References whenInfeasible_.
|
inline |
Get the CglCutGenerator
bound to this AbcCutGenerator
.
Definition at line 172 of file AbcCutGenerator.h.
References generator_.
|
private |
The client model.
Definition at line 178 of file AbcCutGenerator.h.
|
private |
Definition at line 181 of file AbcCutGenerator.h.
Referenced by generator().
|
private |
Number of nodes between calls to the CglCutGenerator::generateCuts
routine.
Definition at line 186 of file AbcCutGenerator.h.
Referenced by howOften().
|
private |
Name of generator.
Definition at line 189 of file AbcCutGenerator.h.
Referenced by cutGeneratorName().
|
private |
Whether to call the generator in the normal place.
Definition at line 192 of file AbcCutGenerator.h.
Referenced by normal(), and setNormal().
|
private |
Whether to call the generator when a new solution is found.
Definition at line 195 of file AbcCutGenerator.h.
Referenced by atSolution(), and setAtSolution().
|
private |
Whether to call generator when a subproblem is found to be infeasible.
Definition at line 198 of file AbcCutGenerator.h.
Referenced by setWhenInfeasible(), and whenInfeasible().