Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.