How to declare an empty global environment in R?
AnsweredHello, I would like to know if/how I can declare an empty global Gurobi environment in the R API, just like one would do in Python or C++ (using the GRBEnv constructors). The documentation states that each Gurobi function in R creates a local environment and checks for the license every time it is called. I would like to avoid this behavior and instead reuse a single global environment for efficiency purposes.
The optional env argument does not have any named components that would allow me to do what I aim to do. Is there a way to achieve this in R? Thanks in advance.
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi,
Unfortunately, this is not possible in R. As you might have seen already from our documentation:
By default, the various Gurobi functions will look for a valid license file and create a local Gurobi environment. This environment exists for as long as the corresponding R API function is running, and is released upon completion.
You cannot re-use a Gurobi environment. It's also usually not very time-intensive to construct a new env.
Our Python API is more flexible in that regard and also very user-friendly.
Cheers,
Matthias0
Post is closed for comments.
Comments
2 comments