14 #include "CbcCompareBase.hpp"
15 #include "CbcTree.hpp"
16 #include "IpRegOptions.hpp"
17 #include "IpOptionsList.hpp"
18 #include "CbcCompareActual.hpp"
42 virtual CbcTree *
clone()
const;
46 virtual CbcNode *
top()
const;
50 virtual void push(CbcNode * x);
54 virtual CbcNode *
bestNode(
double cutoff);
64 return (static_cast<int>(nodes_.size()) + (
nextOnBranch_ != NULL) );
75 virtual void cleanTree(CbcModel * model,
double cutoff,
double & bestPossibleObjective);
88 static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
124 virtual CbcTree *
clone()
const;
128 virtual CbcNode *
top()
const;
132 virtual void push(CbcNode * x);
136 virtual CbcNode *
bestNode(
double cutoff);
142 virtual bool empty();
157 virtual void cleanTree(CbcModel * model,
double cutoff,
double & bestPossibleObjective);
220 virtual CbcTree *
clone()
const;
224 virtual CbcNode *
top()
const;
228 virtual void push(CbcNode * x);
232 virtual CbcNode *
bestNode(
double cutoff);
238 virtual bool empty();
254 virtual void cleanTree(CbcModel * model,
double cutoff,
double & bestPossibleObjective);
261 static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
343 CbcCompareBase::operator=(rhs);
358 virtual CbcCompareBase *
clone()
const
364 virtual bool test (CbcNode * x, CbcNode * y);
371 double objectiveAtContinuous,
372 int numberInfeasibilitiesAtContinuous);
virtual void pop()
Remove the top node of the heap.
void initialize(BabSetupBase &b)
Initialize the method (get options)
void setComparisonMode(ComparisonModes newMode)
Changes the mode of comparison of the tree for "safety reasons" if the mode really changes we always ...
bool treeCleaning_
Say if we are cleaning the tree (then only call CbcTree functions).
CbcDiver()
Default constructor.
virtual void pop()
Remove the top node of the heap.
void initialize(BabSetupBase &b)
Initialize the method (get options)
virtual CbcNode * top() const
Return top node (next node to process.*/.
CbcNode * candidateChild_
Candidate child explored.
virtual double getBestPossibleObjective()
Get best possible objective function in the tree.
virtual ~CbcDfsDiver()
Destructor.
virtual CbcCompareBase * clone() const
Clone.
virtual void push(CbcNode *x)
Add node to the heap.
virtual bool empty()
Test if empty.
double cutoff_
Last reported cutoff.
virtual void pop()
Remove the top node of the heap.
std::list< CbcNode * > dive_
List of the nodes in the current dive.
CbcCompareBase * comparisonDive_
Comparison method used in diving mode.
void setComparisonBound(const CbcCompareBase &val)
Set comparison method when closing bound.
void initialize(BabSetupBase &b)
Initialize the method (get options)
virtual CbcNode * bestNode(double cutoff)
Remove the best node from the heap and return it.
bool treeCleaning_
Say if we are cleaning the tree (then only call CbcTree functions).
DiverCompare(const DiverCompare &rhs)
int nBacktracks_
number of backtracks done in current dive.
virtual bool every1000Nodes(CbcModel *model, int numberNodes)
Called 1000 nodes.
int treeCleaning_
Flag to say that we are currently cleaning the tree and should work only on the heap.
CbcNode * nextOnBranch_
Noext node on the branch.
void setDiver(CbcDfsDiver *diver)
Set the dfs diver to use.
virtual bool test(CbcNode *x, CbcNode *y)
This is test function.
virtual CbcTree * clone() const
Virtual copy constructor.
A class to have all elements necessary to setup a branch-and-bound.
DiverCompare & operator=(const DiverCompare &rhs)
virtual void cleanTree(CbcModel *model, double cutoff, double &bestPossibleObjective)
Prune the tree using an objective function cutoff.
CbcDfsDiver * diver_
Pointer to the CbcDfsDiver handling the tree.
int maxDiveBacktracks_
Maximum number of backtrack in one dive.
bool stop_diving_on_cutoff_
Flag indicating if we want to stop diving based on the guessed objective value and the cutoff value ...
int maxDepthBFS_
Maximum depth until which we'll do a bredth-first-search.
virtual CbcNode * bestNode(double cutoff)
Remove the best node from the heap and return it.
virtual ~CbcProbedDiver()
Destructor.
virtual CbcTree * clone() const
Virtual copy constructor.
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register the options of the method.
CbcProbedDiver & operator=(const CbcProbedDiver &rhs)
Assignment operator.
A more elaborate diving class.
CbcDfsDiver()
Default constructor.
ComparisonModes getComparisonMode()
get the mode of comparison of the tree.
virtual int size()
Give size of the tree.
void setNumberNodesToLimitTreeSize(int val)
Set numberNodesToLimitTreeSize_.
ComparisonModes mode_
Current mode of the diving strategy.
CbcDiver & operator=(const CbcDiver &rhs)
Assignment operator.
virtual bool empty()
Test if empty.
virtual void cleanTree(CbcModel *model, double cutoff, double &bestPossibleObjective)
Prune the tree using an objective function cutoff.
int numberNodesToLimitTreeSize_
Number of nodes before we command diver_ to limit the tree size.
virtual void endSearch()
Don't know what this is yet?
At the very beginning we might want to enlarge the tree just a bit.
CbcProbedDiver()
Default constructor.
virtual CbcNode * top() const
Return top node (next node to process.*/.
bool stop_diving_on_cutoff_
Flag indicating if we want to stop diving based on the guessed objective value and the cutoff value ...
virtual void endSearch()
Don't know what this is yet?
virtual CbcNode * bestNode(double cutoff)
Remove the best node from the heap and return it.
virtual bool empty()
Test if empty.
virtual void endSearch()
Don't know what this is yet?
int divingBoardDepth_
Depth of the node from which diving was started (we call this node the diving board).
virtual void cleanTree(CbcModel *model, double cutoff, double &bestPossibleObjective)
Prune the tree using an objective function cutoff.
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register the options of the method.
CbcCompareBase * comparisonBound_
Comparison method used bound mode.
void setNumberSolToStopDive(int val)
Set numberSolToStopDive_.
virtual double getBestPossibleObjective()
Get best possible objective function in the tree.
CbcCompareDepth comparisonDepth_
Comparison method used when limit tree size.
virtual CbcNode * top() const
Return top node (next node to process.*/.
CbcDfsDiver & operator=(const CbcDfsDiver &rhs)
Assignment operator.
virtual double getBestPossibleObjective()
Get best possible objective function in the tree.
int numberSolToStopDive_
Number of solution before we command diver_ to stop diving.
virtual int size()
Give size of the tree.
void pushDiveOntoHeap(double cutoff)
Pushes onto heap all the nodes with objective value > cutoff.
virtual void push(CbcNode *x)
Add node to the heap.
Class to do probed diving in the tree.
void setComparisonDive(const CbcCompareBase &val)
Set comparison method when diving.
CbcNode * nextOnBranch_
Next node on the branch.
virtual int size()
Give size of the tree.
virtual bool newSolution(CbcModel *model)
Called after each new solution.
Class to do diving in the tree.
virtual CbcTree * clone() const
Virtual copy constructor.
int diveListSize_
Record dive list size for constant time access.
virtual void push(CbcNode *x)
Add node to the heap.
int maxDiveDepth_
Maximum depth to go from divingBoard.
virtual ~CbcDiver()
Destructor.