Ask Your Question
4

What is the method to retrieve the value of a variable by its name in pySCIPopt?

asked 2023-06-29 20:55:38 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-06-29 21:11:01 +0000

lakamha gravatar image

In pySCIPopt, you can retrieve the value of a variable by its name using the following code:

val = model.getVal(model.getVarByName(var_name))

Here, var_name is the name of the variable you want to retrieve the value of, and model is the SCIP model object. The getVarByName() method returns the variable object with the specified name, and the getVal() method returns its current value.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-29 20:55:38 +0000

Seen: 8 times

Last updated: Jun 29 '23