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.
-
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
Please sign in to leave a comment.
Comments
1 comment