![]() |
MAiNGO
|
Class representing a node in the Branch-and-Bound tree. More...
#include <babNode.h>
Public Member Functions | |
BabNode (double pruningScoreIn, const std::vector< double > &lbdsIn, const std::vector< double > &ubdsIn, const int idIn, const unsigned depthIn, const bool holdsIncumbent) | |
Constructor for initializing a BabNode using separate vectors containing the bounds. More... | |
BabNode (double pruningScoreIn, const std::vector< OptimizationVariable > &variablesIn, const int idIn, const unsigned depthIn, const bool holdsIncumbent) | |
Constructor for initializing a BabNode using a vector of OptimizationVariable (each of which contains a Bounds object). Used to initialize the root node. More... | |
BabNode () | |
Default constructor. More... | |
double | get_pruning_score () const |
Function for querying the pruning score within this node. More... | |
void | set_pruning_score (double pruningScoreIn) |
Function for setting the pruning score within this node. More... | |
std::vector< double > | get_lower_bounds () const |
Function for querying the lower bounds on the optimization variables within this node. More... | |
std::vector< double > | get_upper_bounds () const |
Function for querying the upper bounds on the optimization variables within this node. More... | |
int | get_ID () const |
Function for querying the node ID. More... | |
int | get_depth () const |
Function for querying the node depth. More... | |
bool | holds_incumbent () const |
Function obtaining information whether the node holds the incumbent. More... | |
void | set_holds_incumbent (const bool holdsIncumbent) |
Function for setting the _holdsIncumbent variable. More... | |
void | set_upper_bound (const std::vector< double > upperBounds) |
Function for setting the whole upper bound vector. More... | |
void | set_upper_bound (const unsigned iVar, const double value) |
Function for setting the whole upper bound vector. More... | |
void | set_lower_bound (const std::vector< double > lowerBounds) |
Function for setting the whole upper bound vector. More... | |
void | set_lower_bound (const unsigned iVar, const double value) |
Function for setting the whole upper bound vector. More... | |
Private Attributes | |
Internal variables of a B&B node | |
std::vector< double > | _lowerBounds |
std::vector< double > | _upperBounds |
int | _idNumber |
unsigned | _depth |
double | _pruningScore |
bool | _holdsIncumbent |
Friends | |
std::ostream & | operator<< (std::ostream &out, const BabNode &node) |
Overloaded operator for easier output. Definition of this operator is in bab.cpp. More... | |
Class representing a node in the Branch-and-Bound tree.
A BabNode is characterized by a vector containing the configuration for optimization variables (bounds etc.) in this node, as well as an ID (both private members). It also contains a pruning score and a flag that indicates whether it holds the incumbent. Once constructed, a BabNode cannot be modified.
|
inline |
Constructor for initializing a BabNode using separate vectors containing the bounds.
[in] | pruningScoreIn | is the score of the node with respect to its pruning rule, a pruning score higher than a certain threshold will lead to pruning of the node |
[in] | lbdsIn | is a vector containing the lower bounds on the optimization variables for this node |
[in] | ubdsIn | is a vector containing the upper bounds on the optimization variables for this node |
[in] | idIn | is the ID to be associated with this node |
[in] | depthIn | is the depth of the node in the tree |
[in] | holdsIncumbent | tells whether the node holds the current incumbent |
|
inline |
Constructor for initializing a BabNode using a vector of OptimizationVariable (each of which contains a Bounds object). Used to initialize the root node.
[in] | pruningScoreIn | is the score of the node with respect to its pruning rule, a pruning score higher than a certain threshold will lead to pruning of the node |
[in] | variablesIn | is a vector containing the optimization variables |
[in] | idIn | is the ID to be associated with this node |
[in] | depthIn | is the depth of the node in the tree |
[in] | holdsIncumbent | tells whether the node holds the current incumbent |
|
inline |
Default constructor.
|
inline |
Function for querying the node depth.
|
inline |
Function for querying the node ID.
|
inline |
Function for querying the lower bounds on the optimization variables within this node.
|
inline |
Function for querying the pruning score within this node.
|
inline |
Function for querying the upper bounds on the optimization variables within this node.
|
inline |
Function obtaining information whether the node holds the incumbent.
|
inline |
Function for setting the _holdsIncumbent variable.
|
inline |
Function for setting the whole upper bound vector.
|
inline |
Function for setting the whole upper bound vector.
|
inline |
Function for setting the pruning score within this node.
|
inline |
Function for setting the whole upper bound vector.
|
inline |
Function for setting the whole upper bound vector.
|
friend |
Overloaded operator for easier output. Definition of this operator is in bab.cpp.
[out] | out | is the outstream to be written to |
[in] | node | is the B&B node to be printed |
|
private |
Depth of this node in the B&B tree
|
private |
Variable telling whether this nodes holds the current incumbent
|
private |
Node ID
|
private |
Lower bounds on optimization variables within this node
|
private |
PruningScore: if PruningScore is higher than a PruningThreshold, the node will be fathomed by and from the BAB-Tree
|
private |
Upper bounds on optimization variables within this node