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);
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);
343 CbcCompareBase::operator=(rhs);
358 virtual CbcCompareBase *
clone()
const
364 virtual bool test (CbcNode *
x, CbcNode * y);
371 double objectiveAtContinuous,
372 int numberInfeasibilitiesAtContinuous);
virtual ~CbcDfsDiver()
Destructor.
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.
void initialize(BabSetupBase &b)
Initialize the method (get options)
virtual bool empty()
Test if empty.
CbcNode * candidateChild_
Candidate child explored.
virtual bool every1000Nodes(CbcModel *model, int numberNodes)
Called 1000 nodes.
virtual CbcCompareBase * clone() const
Clone.
CbcDiver & operator=(const CbcDiver &rhs)
Assignment operator.
virtual void push(CbcNode *x)
Add node to the heap.
double cutoff_
Last reported cutoff.
std::list< CbcNode * > dive_
List of the nodes in the current dive.
virtual ~CbcDiver()
Destructor.
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)
bool treeCleaning_
Say if we are cleaning the tree (then only call CbcTree functions).
DiverCompare(const DiverCompare &rhs)
virtual CbcNode * top() const
Return top node (next node to process.*/.
virtual CbcNode * top() const
Return top node (next node to process.*/.
virtual void push(CbcNode *x)
Add node to the heap.
int nBacktracks_
number of backtracks done in current dive.
int treeCleaning_
Flag to say that we are currently cleaning the tree and should work only on the heap.
virtual void pop()
Remove the top node of the heap.
CbcNode * nextOnBranch_
Noext node on the branch.
void setDiver(CbcDfsDiver *diver)
Set the dfs diver to use.
virtual double getBestPossibleObjective()
Get best possible objective function in the tree.
A class to have all elements necessary to setup a branch-and-bound.
virtual bool empty()
Test if empty.
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register the options of the method.
DiverCompare & operator=(const DiverCompare &rhs)
virtual CbcTree * clone() const
Virtual copy constructor.
CbcDfsDiver * diver_
Pointer to the CbcDfsDiver handling the tree.
virtual CbcNode * bestNode(double cutoff)
Remove the best node from the heap and return it.
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 ...
virtual CbcNode * bestNode(double cutoff)
Remove the best node from the heap and return it.
int maxDepthBFS_
Maximum depth until which we'll do a bredth-first-search.
virtual void cleanTree(CbcModel *model, double cutoff, double &bestPossibleObjective)
Prune the tree using an objective function cutoff.
virtual bool newSolution(CbcModel *model)
Called after each new solution.
virtual CbcNode * top() const
Return top node (next node to process.*/.
A more elaborate diving class.
virtual void cleanTree(CbcModel *model, double cutoff, double &bestPossibleObjective)
Prune the tree using an objective function cutoff.
CbcDfsDiver()
Default constructor.
virtual double getBestPossibleObjective()
Get best possible objective function in the tree.
CbcDfsDiver & operator=(const CbcDfsDiver &rhs)
Assignment operator.
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.
virtual bool test(CbcNode *x, CbcNode *y)
This is test function.
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.
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?
CbcProbedDiver & operator=(const CbcProbedDiver &rhs)
Assignment operator.
virtual void pop()
Remove the top node of the heap.
virtual void endSearch()
Don't know what this is yet?
virtual CbcTree * clone() const
Virtual copy constructor.
int divingBoardDepth_
Depth of the node from which diving was started (we call this node the diving board).
virtual CbcTree * clone() const
Virtual copy constructor.
virtual void pop()
Remove the top node of the heap.
CbcCompareBase * comparisonBound_
Comparison method used bound mode.
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register the options of the method.
void setNumberSolToStopDive(int val)
Set numberSolToStopDive_.
CbcCompareDepth comparisonDepth_
Comparison method used when limit tree size.
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 cleanTree(CbcModel *model, double cutoff, double &bestPossibleObjective)
Prune the tree using an objective function cutoff.
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 empty()
Test if empty.
virtual CbcNode * bestNode(double cutoff)
Remove the best node from the heap and return it.
virtual ~CbcProbedDiver()
Destructor.
virtual void push(CbcNode *x)
Add node to the heap.
Class to do diving in the tree.
virtual double getBestPossibleObjective()
Get best possible objective function in the tree.
int diveListSize_
Record dive list size for constant time access.
int maxDiveDepth_
Maximum depth to go from divingBoard.
void fint fint fint real fint real * x