Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
XiangyuYang-Opt opened this issue Dec 14, 2021 · 6 comments

Comments

@XiangyuYang-Opt
Copy link

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.

@gasse
Copy link
Member

gasse commented Dec 21, 2021

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

@XiangyuYang-Opt
Copy link
Author

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.

@gasse
Copy link
Member

gasse commented Dec 22, 2021

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

@LeonaireHo
Copy link

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.

@gasse
Copy link
Member

gasse commented Apr 27, 2022

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

@FosingC
Copy link

FosingC commented Aug 31, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants