Closed RafaHPSUnicamp closed 1 year ago
This line is returning a tuple of length one (the trailing comma). The line below it is not evaluated.
return [-1*(S_comercio*S_preco - S_comercio*S_custo + F_comercio*F_preco - F_comercio*F_custo + OB_comercio*OB_preco - OB_comercio*OB_custo + OR_comercio*OR_preco - OR_comercio*OR_custo + B_total*B_preco - B_total*B_custo),1],
Try this instead:
objs = [-1*(S_comercio*S_preco - S_comercio*S_custo + F_comercio*F_preco - F_comercio*F_custo + OB_comercio*OB_preco - OB_comercio*OB_custo + OR_comercio*OR_preco - OR_comercio*OR_custo + B_total*B_preco - B_total*B_custo),1]
constrs = [
S_total - S_comercio - S_insumo,
S_insumo - C_insumo - F_comercio - OB_total,
C_insumo - 0.04*S_insumo,
OB_total - (F_comercio*OBF_percentoleo)/(1 - OBF_percentoleo),
OB_total - OB_comercio - OR_total,
OR_total - OR_comercio - OR_biodiesel,
OR_biodiesel - MOL*OR_massamolar,
M_insumo - 3*MOL*M_massamolar,
B_total - 3*MOL*B_massamolar,
G_comercio - MOL*G_massamolar,
S_insumo - S_capacidade,
OR_total - OR_capacidade,
B_total - B_capacidade,
S_comercio - S_demanda,
F_comercio** - F_demanda,
OB_comercio - OB_demanda,
OR_comercio - OR_demanda,
B_total - B_demanda
]
return objs, constrs
Yeah, it works. Thanks. Now I need to know how to plot the best result from this code:
for solution in algorithm.result: print(solution.objectives)
There is a way to know how is the best result from the list plotted. Also, I needed to know the same for the variables. I know that plot for them is:
for solution in algorithm.result: print(solution.variables)
This issue is stale and will be closed soon. If you feel this issue is still relevant, please comment to keep it active. Please also consider working on a fix and submitting a PR.
Hi. I am trying to adapt my problem from LINGO software to Playtpus language and I cannot run this code. Someone can help to tell me what was wrong? The code is:
And yep, the problem is single objective to later turn on multiobjective. LINGO does support only only one objective.
And the issue is:
I cannot understand what I did wrong. Someone can help me? Does anyone knows Playtpus tool from Python library?