Skip to content

Output logs from pyscipopt #881

Discussion options

You must be logged in to vote

Hey @sheepone12138, sorry for the absurdly large delay. I think this does what you want

from pyscipopt import Model, Eventhdlr, SCIP_EVENTTYPE, Eventhdlr

    class gapEventhdlr(Eventhdlr):

        def eventinit(self): # we want to collect best primal solutions and best dual solutions
            self.model.catchEvent(SCIP_EVENTTYPE.BESTSOLFOUND, self)
            self.model.catchEvent(SCIP_EVENTTYPE.LPSOLVED, self)

        def eventexec(self, event):
            # if a new best primal solution was found, we save when it was found and also its objective
            if event.getType() == SCIP_EVENTTYPE.BESTSOLFOUND:
                self.model.data["primal_solutions"].append((self.model.g…

Replies: 2 comments 13 replies

Comment options

You must be logged in to vote
8 replies
@mmghannam
Comment options

@Joao-Dionisio
Comment options

@sheepone12138
Comment options

@Joao-Dionisio
Comment options

@sheepone12138
Comment options

Comment options

You must be logged in to vote
5 replies
@sheepone12138
Comment options

@sheepone12138
Comment options

@sheepone12138
Comment options

@mmghannam
Comment options

@Joao-Dionisio
Comment options

Answer selected by sheepone12138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants