learn2branch icon indicating copy to clipboard operation
learn2branch copied to clipboard

Regarding scip.Model.getState() for extracting the state of the solver

Open ghost opened this issue 3 years ago • 6 comments
trafficstars

Hi, all,

I want to ask that what the alternatives are for the function scip.Model.getState()? It seems that .getState() is an old-fashioned usage, and it is not available to see on Model Class Reference (i.e., on SCIP Official website) anymore. Could anyone help with this?

Thanks in advance.

ghost avatar Dec 14 '21 03:12 ghost

Hi @XiangyuYang-Opt ,

The alternative in Ecole is the NodeBipartite observation, available here: https://doc.ecole.ai/py/en/stable/reference/observations.html#node-bipartite

It basically extracts the same information, but has been re-engineered in C++ (including also minor bug fixes that were present in the original getState()).

Best, Maxime

gasse avatar Dec 21 '21 16:12 gasse

Thanks @gasse for replying!

Further, I would like to ask if the original code for model.getState() can be provided in this project? As I understand, this model.getState() method is coded by yourself and is integrated into the SCIPopt package, e.g., the scip.pyx file.

Thanks.

XiangyuYang-Opt avatar Dec 22 '21 06:12 XiangyuYang-Opt

You will find that function in a dedicated ml-branching branch in our PySCIPOpt fork here: https://github.com/ds4dm/PySCIPOpt/blob/9b88eddcfe99208e737236d39ccd6c9dd1a9bec4/src/pyscipopt/scip.pyx#L3917

Best, Maxime

gasse avatar Dec 22 '21 16:12 gasse

Hi, @gasse Hello, after I installed it with your github branch, it still couldn't find the function getState in scip.Model. Is it normal? What else do I need to configure?

Thanks in advance.

LeonaireHo avatar Apr 27 '22 06:04 LeonaireHo

Hi @LeonaireHo . Most likely you've installed from the main branch. The getState() function is only available in the ml-branching branch. You should be able to install using:

pip install git+https://github.com/ds4dm/PySCIPOpt.git@ml-branching

gasse avatar Apr 27 '22 15:04 gasse

Hi @gasse , when use the command pip install git+https://github.com/ds4dm/PySCIPOpt.git@ml-branching , the error information showed below: gcc -pthread -B /home/zhangliang/anaconda3/envs/rl11/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-req-build-okb3jayy/include -I/home/zhangliang/anaconda3/envs/rl11/lib/python3.6/site-packages/numpy/core/include -I/home/zhangliang/anaconda3/envs/rl11/include/python3.6m -c src/pyscipopt/scip.c -o build/temp.linux-x86_64-3.6/src/pyscipopt/scip.o src/pyscipopt/scip.c:648:10: fatal error: scip/scip.h: No such file or directory 648 | #include "scip/scip.h" | ^~~~~~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1 ---------------------------------------- how can I solve it? Thanks!

FosingC avatar Aug 31 '23 14:08 FosingC