Beispiel #1
0
// First or second branch
CbcStatistics::CbcStatistics(CbcNode * node, CbcModel * model)
        :  endingObjective_(COIN_DBL_MAX),
        endingInfeasibility_(0),
        numberIterations_(0)
{
    CbcNodeInfo * nodeInfo = node->nodeInfo();
    CbcNodeInfo * parent = nodeInfo->parent();
    int numberBranches = nodeInfo->numberBranchesLeft();
    const CbcBranchingObject * branch = dynamic_cast <const CbcBranchingObject *>(node->branchingObject());
    const OsiTwoWayBranchingObject * branch2 = dynamic_cast <const OsiTwoWayBranchingObject *>(node->branchingObject());
    startingObjective_ = node->objectiveValue();
    way_ = node->way();
    depth_ = node->depth();
    startingInfeasibility_ = node->numberUnsatisfied();
    if (branch) {
        sequence_ = branch->variable();
        value_ = branch->value();
    } else {
        const OsiSimpleInteger * obj = dynamic_cast<const OsiSimpleInteger *>(branch2->originalObject());
        assert (obj);
        sequence_ = obj->columnNumber();
        value_ = branch2->value();
    }
    if (parent)
        parentId_ = parent->nodeNumber();
    else
        parentId_ = -1;
    if (numberBranches == 2) {
        id_ = nodeInfo->nodeNumber();
    } else {
        way_ *= 10;
        id_ = model->getNodeCount2();
    }
}