Skip to content

Is there a way to get the optimal objective value of MILP solved by SCIP as information_function? #164

Discussion options

You must be logged in to vote

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
)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@thupchnsky
Comment options

@AntoinePrv
Comment options

@thupchnsky
Comment options

@AntoinePrv
Comment options

Answer selected by thupchnsky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants