Need help with multiple indices and reading from a dataframe for model parameters
Awaiting user inputHi
I am new to Gurobi Python interface and looking for suggestions for a modeling issue. I am running two optimization models (in sequence), where I am passing a dataframe from one function to another. The data in the dataframe will be used as a parameter in the next model. I am not sure if I am building the optimization model right. It would be great if I could get any suggestions. My current objective function is below. For two indices j and t, I have the following decision variable.
Xuj = model.addVars(j,T+1, vtype=GRB.CONTINUOUS, name="Xuj")
My objective function is below.
obj = a * gp.quicksum((Xuj[j,t]) for j in range (6) for t in range(0,T+1))
+ g * gp.quicksum((Yuj.iloc[j,t]) for j in range (6) for t in range(0,T+1))
Yuj is a parameter in the model from the dataframe passed from the previous function.
-
Official comment
This post is more than two 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 Mayukh,
Can you please provide a complete piece of code to reproduce your error? We have a tutorial on preparing a minimal reproducible example for cases like these.
Best regards,
Lennart0
Post is closed for comments.
Comments
2 comments