Access models referencing an environment
回答済みIn gurobipy, is it possible to query the `gurobipy.Env` object in some way to return a list of models that were created with that environment?
-
Hi Ollie,
There is not, but you could probably build this functionality another way. What is your use-case?
Note, as a commercial customer you are entitled to open up Support Requests through the Gurobi Help Center for faster responses and more in-depth support.
- Riley
0 -
Thanks Riley - I'll bear that in mind for future questions! Will continue here for this one :)
The use case is our application is creating a gurobipy.Env object, but an external library is responsible for creating the gurobipy.Model object. So was thinking about neat ways for implementing tear down (calling the .close() / .dispose() methods) on both the Model and the Env without needing a direct reference to the Model object. I figured some combination of monkeypatching and weakref could solve the problem...
In the end though, I concluded it's probably simpler to just not worry about Model & Env tear down because garbage collection will do that anyway right? The application in this case is not staying alive to do anything beyond writing an output file after the optimisation has been finished, so it's not saving much to manually tear down the Model / Env.
0 -
Hi Ollie,
I will turn this into a ticket, I think it will be easier to keep track of it.
You will receive an email shortly regarding this.
- Riley
0
サインインしてコメントを残してください。
コメント
3件のコメント