How to use the pyscipopt.SCIP_EVENTTYPE function in PySCIPOpt

To help you get started, we’ve selected a few PySCIPOpt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SCIP-Interfaces / PySCIPOpt / tests / test_tree.py View on Github external
def eventinit(self):
        self.model.catchEvent(SCIP_EVENTTYPE.NODEFOCUSED, self)
github SCIP-Interfaces / PySCIPOpt / tests / test_event.py View on Github external
def eventinit(self):
        calls.append('eventinit')
        self.model.catchEvent(SCIP_EVENTTYPE.FIRSTLPSOLVED, self)
github SCIP-Interfaces / PySCIPOpt / tests / test_event.py View on Github external
def eventexit(self):
        calls.append('eventexit')
        self.model.dropEvent(SCIP_EVENTTYPE.FIRSTLPSOLVED, self)
github SCIP-Interfaces / PySCIPOpt / tests / test_tree.py View on Github external
def eventexec(self, event):
        self.calls.append('eventexec')
        assert event.getType() == SCIP_EVENTTYPE.NODEFOCUSED
        node = event.getNode()
        
        if node.getDepth() == 0:
            assert node.getParent() is None
            assert node.getParentBranchings() is None
            return

        variables, branchbounds, boundtypes = node.getParentBranchings()
        assert len(variables) == 1
        assert len(branchbounds) == 1
        assert len(boundtypes) == 1
        domain_changes = node.getDomchg()
        bound_changes = domain_changes.getBoundchgs()
        assert len(bound_changes) == 1
github SCIP-Interfaces / PySCIPOpt / examples / finished / primal_dual.py View on Github external
def eventinit(self):
        self.model.catchEvent(SCIP_EVENTTYPE.LPSOLVED, self)
        self.model.catchEvent(SCIP_EVENTTYPE.BESTSOLFOUND, self)
github SCIP-Interfaces / PySCIPOpt / examples / finished / primal_dual.py View on Github external
def eventexit(self):
        self.model.dropEvent(SCIP_EVENTTYPE.LPSOLVED, self)
        self.model.dropEvent(SCIP_EVENTTYPE.BESTSOLFOUND, self)

        pbs.append(self.model.getPrimalbound())
        tpbs.append(self.model.getSolvingTime())
        dbs.append(dbs[-1])
        tdbs.append(self.model.getSolvingTime())