Output logs from pyscipopt #881
-
I'm working on a project where I need to output the error during the iteration when the solver is running and plot it as a curve. How should I do this and how can I output the running log as a file? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
Hello, @sheepone12138! When you say error, do you mean an error in SCIP, or some sort of error in your project? If you know what is causing your error and when it's happening (in relation to the solving process), you can try implementing an event handler. For example, suppose your error shows up when solving the LP in some node. Then, in the event handler you need to catch the event SCIP_EVENTTYPE_LPSOLVED in Here is a list of all events available in SCIP. You can look here for an example on using event handlers. If you're having problem with this, you can tell me more details and I can try to help out. To ouput the log into a file, you can try using redirectOutput(). I've never used this, so I don't know how it works, sorry :( |
Beta Was this translation helpful? Give feedback.
-
Hey @sheepone12138, sorry for the absurdly large delay. I think this does what you want
Using the model from helpers with a 5-second limit:
And this matplotlib code
I get this It's what you wanted, right? |
Beta Was this translation helpful? Give feedback.
Hey @sheepone12138, sorry for the absurdly large delay. I think this does what you want