Skip to content

Commit 1d8d2c8

Browse files
'restricoesV2'
1 parent 04c3a52 commit 1d8d2c8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

solver.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,18 @@
168168
right_c2 = opt_mod.sum(((limitante[elementos.index('PB')]/100)*demanda - ((limitanteMaxInf[elementos.index('PB')]/100)*(limitante[elementos.index('PB')]/100)*demanda)) for i in range(len(ingredientes)))
169169
opt_mod.add_constraint(left_c2 >= right_c2, ctname='c2')
170170

171+
left_c3 = opt_mod.sum((valores[i][elementos.index('PB')]/100)*q[i] for i in range(len(ingredientes)))
172+
right_c3 = opt_mod.sum(((limitante[elementos.index('PB')]/100)*demanda + ((limitanteMaxSup[elementos.index('PB')]/100)*(limitante[elementos.index('PB')]/100)*demanda)) for i in range(len(ingredientes)))
173+
opt_mod.add_constraint(left_c3 >= right_c3, ctname='c3')
174+
175+
left_c4 = opt_mod.sum((valores[i][elementos.index('NDT')]/100)*q[i] for i in range(len(ingredientes)))
176+
right_c4 = opt_mod.sum(((limitante[elementos.index('NDT')]/100)*demanda - ((limitanteMaxInf[elementos.index('NDT')]/100)*(limitante[elementos.index('NDT')]/100)*demanda)) for i in range(len(ingredientes)))
177+
opt_mod.add_constraint(left_c4 >= right_c4, ctname='c4')
178+
179+
left_c5 = opt_mod.sum((valores[i][elementos.index('NDT')]/100)*q[i] for i in range(len(ingredientes)))
180+
right_c5 = opt_mod.sum(((limitante[elementos.index('NDT')]/100)*demanda + ((limitanteMaxSup[elementos.index('NDT')]/100)*(limitante[elementos.index('NDT')]/100)*demanda)) for i in range(len(ingredientes)))
181+
opt_mod.add_constraint(left_c5 >= right_c5, ctname='c5')
182+
171183

172184
#Define a funcao objetivo
173185
opt_mod.set_objective('min', obj)

0 commit comments

Comments
 (0)