Is there a way to get the optimal objective value of MILP solved by SCIP as information_function? #164
-
Hi, I know that there are many things in ecole.reward can be added into information function when defining the environment. For example, I can define a SCIP solver as |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hello @thupchnsky There is no such things in Ecole for now, but you can define it for yourself using PySCIPOpt: class BestObjVal:
def before_reset(self, model): # Edit added missing function
pass
def extract(self, model, done):
m = model.as_pyscipopt()
return m.getSolObjVal(m.getBestSol()) And then: default_env = ecole.environment.Configuring(
observation_function=None,
information_function={
"nb_nodes": ecole.reward.NNodes(),
"time": ecole.reward.SolvingTime(),
"best_obj": BestObjVal(),
},
scip_params=scip_parameters
) |
Beta Was this translation helpful? Give feedback.
Hello @thupchnsky
There is no such things in Ecole for now, but you can define it for yourself using PySCIPOpt:
And then: