-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README with usage request * small typo * Add cutoff node and test * More explicit test, fix typo everywhere * forgot to save this file...
- Loading branch information
1 parent
193445f
commit b94dbb7
Showing
9 changed files
with
44 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
## Unreleased | ||
### Added | ||
- Added cutoffNode and test | ||
### Fixed | ||
### Changed | ||
### Removed | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from pyscipopt import SCIP_RESULT, Eventhdlr, SCIP_EVENTTYPE | ||
from helpers.utils import random_mip_1 | ||
|
||
class cutoffEventHdlr(Eventhdlr): | ||
def eventinit(self): | ||
self.model.catchEvent(SCIP_EVENTTYPE.NODEFOCUSED, self) | ||
|
||
def eventexec(self, event): | ||
self.model.cutoffNode(self.model.getCurrentNode()) | ||
return {'result': SCIP_RESULT.SUCCESS} | ||
|
||
def test_cutoffNode(): | ||
m = random_mip_1(disable_heur=True, disable_presolve=True, disable_sepa=True) | ||
|
||
hdlr = cutoffEventHdlr() | ||
|
||
m.includeEventhdlr(hdlr, "test", "test") | ||
|
||
m.optimize() | ||
|
||
assert m.getNSols() == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters