minimum of a MVar
AnsweredHi,
I have an MVar names 'z' as below. I want to calculate the min of z after the solution is solved.
z=mod1.addMVar(N_u,lb=0,name='z')
I am using np.amin(z) but I face error. Can you please support?
0
-
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 try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Afsoon,
You need to get the solution values from the MVar first. In this case, you can use np.amin(z.X) to find the minimum of all variable solution values in the array.
0
Post is closed for comments.
Comments
2 comments