#include <CbcHeuristic.hpp>
Inheritance diagram for CbcSerendipity:
Public Member Functions | |
CbcSerendipity () | |
CbcSerendipity (CbcModel &model) | |
CbcSerendipity (const CbcSerendipity &) | |
~CbcSerendipity () | |
virtual CbcHeuristic * | clone () const |
Clone. | |
virtual void | generateCpp (FILE *fp) |
Create C++ lines to get to current state. | |
virtual void | setModel (CbcModel *model) |
update model | |
virtual int | solution (double &objectiveValue, double *newSolution) |
returns 0 if no solution, 1 if valid solution. | |
virtual void | resetModel (CbcModel *model) |
Resets stuff if model changes. | |
Private Member Functions | |
CbcSerendipity & | operator= (const CbcSerendipity &rhs) |
Illegal Assignment operator. |
Definition at line 154 of file CbcHeuristic.hpp.
CbcSerendipity::CbcSerendipity | ( | ) |
CbcSerendipity::CbcSerendipity | ( | CbcModel & | model | ) |
CbcSerendipity::CbcSerendipity | ( | const CbcSerendipity & | ) |
CbcSerendipity::~CbcSerendipity | ( | ) |
virtual CbcHeuristic* CbcSerendipity::clone | ( | ) | const [virtual] |
virtual void CbcSerendipity::generateCpp | ( | FILE * | fp | ) | [virtual] |
virtual void CbcSerendipity::setModel | ( | CbcModel * | model | ) | [virtual] |
virtual int CbcSerendipity::solution | ( | double & | objectiveValue, | |
double * | newSolution | |||
) | [virtual] |
returns 0 if no solution, 1 if valid solution.
Sets solution values if good, sets objective value (only if good) We leave all variables which are at one at this node of the tree to that value and will initially set all others to zero. We then sort all variables in order of their cost divided by the number of entries in rows which are not yet covered. We randomize that value a bit so that ties will be broken in different ways on different runs of the heuristic. We then choose the best one and set it to one and repeat the exercise.
Implements CbcHeuristic.
virtual void CbcSerendipity::resetModel | ( | CbcModel * | model | ) | [virtual] |
CbcSerendipity& CbcSerendipity::operator= | ( | const CbcSerendipity & | rhs | ) | [private] |
Illegal Assignment operator.