52 const double threshold)
const;
62 std::vector< CbcHeuristicNode * >
nodes_;
78 return static_cast< int >(
nodes_.size());
119 virtual int solution(
double &objectiveValue,
194 bool exitNow(
double bestObjective)
const;
242 double *newSolution,
double &newSolutionValue,
243 double cutoff, std::string name)
const;
448 double *lowerBoundLastNode_;
451 double *upperBoundLastNode_;
491 virtual int solution(
double &objectiveValue,
492 double *newSolution);
499 virtual int solution(
double &objectiveValue,
501 double solutionValue);
584 virtual int solution(
double &objectiveValue,
585 double *newSolution);
646 virtual int solution(
double &objectiveValue,
647 double *newSolution);
686 virtual int solution(
double &objectiveValue,
687 double *newSolution);
virtual bool shouldHeurRun(int whereFrom)
Check whether the heuristic should run at all 0 - before cuts at root node (or from doHeuristics) 1 -...
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets sol...
virtual void generateCpp(FILE *fp)
Create C++ lines to get to current state.
int numRuns_
how many times the heuristic has actually run
Abstract branching object base class Now just difference with OsiBranchingObject. ...
void setInputSolution(const double *solution, double objValue)
Set input solution.
double avgDistance(const CbcHeuristicNodeList &nodeList) const
void setFixPriority(int value)
Set priority level.
Partial solution class If user knows a partial solution this tries to get an integer solution it uses...
void addHeuristic(const CbcHeuristic *heuristic, double probability)
Adds an heuristic with probability.
virtual void setModel(CbcModel *model)
update model (This is needed if cliques update matrix etc)
void append(CbcHeuristicNode *&node)
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets sol...
void setMinDistanceToRun(int value)
How "far" should this node be from every other where the heuristic was run in order to allow the heur...
int numberSolutionsFound() const
Get how many solutions the heuristic thought it got.
double distance(const CbcHeuristicNode *node) const
int when() const
Gets "when" flag - 0 off, 1 at root, 2 other than root, 3 always.
virtual CbcHeuristic * clone() const
Clone.
void setHowOftenShallow(int value)
How often to invoke the heuristics in the shallow part of the tree.
CbcHeuristicJustOne & operator=(const CbcHeuristicJustOne &rhs)
Assignment operator.
virtual bool shouldHeurRun(int whereFrom)
Check whether the heuristic should run at all 0 - before cuts at root node (or from doHeuristics) 1 -...
int minDistanceToRun_
How "far" should this node be from every other where the heuristic was run in order to allow the heur...
std::vector< CbcHeuristicNode * > nodes_
void gutsOfCopy(const CbcHeuristic &rhs)
int howOften_
How often to do (code can change)
void incrementNumberSolutionsFound()
Increment how many solutions the heuristic thought it got.
int numInvocationsInDeep_
How many invocations happened when in the deep part of the tree.
A class describing the branching decisions that were made to get to the node where a heuristic was in...
bool isHeuristicInteger(const OsiSolverInterface *solver, int iColumn)
Is it integer for heuristics?
int numberNodes_
Number of nodes in any sub tree.
double fractionSmall() const
Gets fraction of new(rows+columns)/old(rows+columns) before doing small branch and bound (default 1...
std::string heuristicName_
Name for printing.
virtual void validate()
Validate model i.e. sets when_ to 0 if necessary (may be NULL)
CoinPackedMatrix matrixByRow_
int numRuns() const
how many times the heuristic has actually run
virtual int solution(double &objectiveValue, double *newSolution)=0
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets sol...
Sparse Matrix Base Class.
OsiSolverInterface * cloneBut(int type)
Clone, but ...
int getSeed() const
Get random number generator seed.
int numCouldRun() const
How many times the heuristic could run.
Collections of row cuts and column cuts.
int shallowDepth_
Upto this depth we call the tree shallow and the heuristic can be called multiple times...
void setWhen(int value)
Sets "when" flag - 0 off, 1 at root, 2 other than root, 3 always.
virtual void generateCpp(FILE *fp)
Create C++ lines to get to current state.
void setWhereFrom(int value)
int lastRunDeep_
After how many deep invocations was the heuristic run last time.
virtual void validate()
Validate model i.e. sets when_ to 0 if necessary (may be NULL)
int numberNodes() const
Gets number of nodes in a subtree (default 200)
CbcSerendipity & operator=(const CbcSerendipity &rhs)
Assignment operator.
void setHeuristicName(const char *name)
set name of heuristic
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution.
int when_
When flag - 0 off, 1 at root, 2 other than root, 3 always.
void setFractionSmall(double value)
Sets fraction of new(rows+columns)/old(rows+columns) before doing small branch and bound (default 1...
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
virtual void setModel(CbcModel *model)
update model
virtual bool shouldHeurRun(int whereFrom)
Check whether the heuristic should run at all.
void setModelOnly(CbcModel *model)
Just set model - do not do anything else.
void normalizeProbabilities()
Normalize probabilities.
void setNumberNodes(int value)
Sets number of nodes in subtree (default 200)
double minDistance(const CbcHeuristicNodeList &nodeList) const
void setSeed(int value)
Set seed.
void setDecayFactor(double value)
Sets decay factor (for howOften) on failure.
int numInvocationsInShallow_
How many invocations happened within the same node when in a shallow part of the tree.
virtual void validate()
Validate model i.e. sets when_ to 0 if necessary (may be NULL)
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
CbcRounding & operator=(const CbcRounding &rhs)
Assignment operator.
bool minDistanceIsSmall(const CbcHeuristicNodeList &nodeList, const double threshold) const
CbcHeuristicNode & operator=(const CbcHeuristicNode &)
void setFeasibilityPumpOptions(int value)
Sets feasibility pump options (-1 is off)
int smallBranchAndBound(OsiSolverInterface *solver, int numberNodes, double *newSolution, double &newSolutionValue, double cutoff, std::string name) const
Do mini branch and bound - return 0 not finished - no solution 1 not finished - solution 2 finished -...
CbcHeuristicPartial & operator=(const CbcHeuristicPartial &rhs)
Assignment operator.
int numObjects_
The number of branching decisions made.
virtual CbcHeuristic * clone() const =0
Clone.
bool shouldHeurRun_randomChoice()
Check whether the heuristic should run this time.
Just One class - this chooses one at random.
double decayFactor_
How much to increase how often.
Abstract Base Class for describing an interface to a solver.
CbcHeuristic ** heuristic_
heuristic - just picks up any good solution found by solver - see OsiBabSolver
virtual CbcHeuristicJustOne * clone() const
Clone.
virtual void resetModel(CbcModel *model)=0
Resets stuff if model changes.
int switches() const
Switches (does not apply equally to all heuristics) 1 bit - stop once allowable gap on objective reac...
int numberSolutionsFound_
How many solutions the heuristic thought it got.
CbcBranchingObject ** brObj_
The indices of the branching objects.
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
int feasibilityPumpOptions_
Feasibility pump options , -1 is off >=0 for feasibility pump itself -2 quick proximity search -3 lon...
int feasibilityPumpOptions() const
Gets feasibility pump options (-1 is off)
virtual void setModel(CbcModel *model)
update model (This is needed if cliques update matrix etc)
virtual void setModel(CbcModel *model)
update model (This is needed if cliques update matrix etc)
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
bool isHeuristicInteger(int colIndex) const
Return true only if integer and not optional.
virtual CbcHeuristic * clone() const
Clone.
virtual bool selectVariableToBranch(OsiSolverInterface *, const double *, int &, int &)
Selects the next variable to branch on.
Class for thread specific random numbers.
virtual void validate()
Validate model i.e. sets when_ to 0 if necessary (may be NULL)
int numberNodesDone_
How many nodes the heuristic did this go.
virtual int solution2(double &, double *, OsiCuts &)
returns 0 if no solution, 1 if valid solution, -1 if just returning an estimate of best possible solu...
const char * heuristicName() const
return name of heuristic
virtual void generateCpp(FILE *)
Create C++ lines to get to current state.
const CbcHeuristicNode * node(int i) const
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
int howOftenShallow_
How often to invoke the heuristics in the shallow part of the tree.
void setSeed(int value)
Set random number generator seed.
virtual void generateCpp(FILE *fp)
Create C++ lines to get to current state.
void setShallowDepth(int value)
Upto this depth we call the tree shallow and the heuristic can be called multiple times...
CbcHeuristicNodeList & operator=(const CbcHeuristicNodeList &rhs)
CbcHeuristicNodeList runNodes_
The description of the nodes where this heuristic has been applied.
int numCouldRun_
How many times the heuristic could run.
void printDistanceToNodes()
CoinThreadRandom randomNumberGenerator_
Thread specific random number generator.
virtual CbcHeuristic * clone() const
Clone.
bool exitNow(double bestObjective) const
Whether to exit at once on gap.
void gutsOfConstructor(CbcModel &model)
virtual void generateCpp(FILE *fp)
Create C++ lines to get to current state.
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets sol...
int switches_
Switches (does not apply equally to all heuristics) 1 bit - stop once allowable gap on objective reac...
CbcHeuristic & operator=(const CbcHeuristic &rhs)
Assignment operator.
Simple Branch and bound class.
virtual void setModel(CbcModel *model)
update model (This is needed if cliques update matrix etc)
void gutsOfCopy(const CbcHeuristicNodeList &rhs)
double fractionSmall_
Fraction of new(rows+columns)/old(rows+columns) before doing small branch and bound.
virtual bool canDealWithOdd() const
Returns true if can deal with "odd" problems e.g. sos type 2.
void setSwitches(int value)
Switches (does not apply equally to all heuristics) 1 bit - stop once allowable gap on objective reac...