GurobiError: Unsupported type (<class 'gurobipy.TempConstr'>) for LinExpr addition argument
回答済みHi, I'm trying to add the following constraint but i get this error:
GurobiError: Unsupported type (<class 'gurobipy.TempConstr'>) for LinExpr addition argument
The summarized process is as follows:
from itertools import product
pacientes=info_pacientes_modelo['Paciente'].values.tolist()
id_salas=info_salas['ID sala'].values.tolist()
cirujanos=info_cirujanos['ID cirujano'].values.tolist()
horas=[m for m in range(24)]
num_pacientes=len(pacientes)
num_salas=len(id_salas)
num_cirujanos=len(cirujanos)
num_horas=len(horas)
pacientes_salas_hora=list(product(range(num_pacientes),range(num_salas),range(num_horas)))
m.addConstrs((gp.quicksum(z[i,j,k,l]<=16 for i,j,l in pacientes_salas_hora) for k in cirujanos),name="agotamiento_fisico")
The constraint I model is teh following:

I hope you can help me. Thanks for your time.
-
正式なコメント
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?. -
I solved it, thanks :)
m.addConstrs((gp.quicksum(z[i,j,k,l] for i,j,l in pacientes_salas_hora)<=16 for k in cirujanos),name="fisico_total")
0
投稿コメントは受け付けていません。
コメント
2件のコメント