Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pyscipopt/scip.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,8 @@ cdef extern from "scip/scip.h":
SCIP_HEURDATA* heurdata)
SCIP_HEURDATA* SCIPheurGetData(SCIP_HEUR* heur)
SCIP_HEUR* SCIPfindHeur(SCIP* scip, const char* name)
SCIP_HEURTIMING SCIPheurGetTimingmask(SCIP_HEUR* heur)
void SCIPheurSetTimingmask(SCIP_HEUR* heur, SCIP_HEURTIMING timingmask)

#Relaxation plugin
SCIP_RETCODE SCIPincludeRelax(SCIP* scip,
Expand Down
35 changes: 35 additions & 0 deletions src/pyscipopt/scip.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
if rc == SCIP_OKAY:
pass
elif rc == SCIP_ERROR:
raise Exception('SCIP: unspecified error!')

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Integration-test (3.8)

SCIP: unspecified error!

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / test-coverage (3.11)

SCIP: unspecified error!

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Windows-test (3.8)

SCIP: unspecified error!

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Integration-test (3.9)

SCIP: unspecified error!

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Windows-test (3.9)

SCIP: unspecified error!

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Integration-test (3.10)

SCIP: unspecified error!

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Windows-test (3.10)

SCIP: unspecified error!

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Integration-test (3.11)

SCIP: unspecified error!

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Windows-test (3.11)

SCIP: unspecified error!

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Integration-test (3.12)

SCIP: unspecified error!

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / Windows-test (3.12)

SCIP: unspecified error!
elif rc == SCIP_NOMEMORY:
raise MemoryError('SCIP: insufficient memory error!')
elif rc == SCIP_READERROR:
Expand Down Expand Up @@ -2887,6 +2887,41 @@
"""
PY_SCIP_CALL(SCIPsetHeuristics(self._scip, setting, True))

def setHeurTiming(self, heurname, heurtiming):
"""
Set the timing of a heuristic

Parameters
----------
heurname : string, name of the heuristic
heurtiming : PY_SCIP_HEURTIMING
"""
cdef SCIP_HEUR* _heur
n = str_conversion(heurname)
_heur = SCIPfindHeur(self._scip, n)
if _heur == NULL:
raise ValueError("Could not find heuristic <%s>" % heurname)
SCIPheurSetTimingmask(_heur, heurtiming)

def getHeurTiming(self, heurname):
"""
Get the timing of a heuristic

Parameters
----------
heurname : string, name of the heuristic

Returns
-------
SCIP_HEURTIMING
"""
cdef SCIP_HEUR* _heur
n = str_conversion(heurname)
_heur = SCIPfindHeur(self._scip, n)
if _heur == NULL:
raise ValueError("Could not find heuristic <%s>" % heurname)
return SCIPheurGetTimingmask(_heur)

def disablePropagation(self, onlyroot=False):
"""
Disables propagation in SCIP to avoid modifying the original problem during transformation.
Expand Down
Loading