kleiner Fehler
This commit is contained in:
parent
51df63666e
commit
fcf4a3177a
|
@ -15,11 +15,11 @@ param pill_penalty {z in ZUTATEN, i in INDEX} default 0; #für einzelne Zutaten
|
|||
var kaufpreis = sum {z in ZUTATEN} preis[z]/10*menge[z]; #Alnatura-Preise sind in 1kg statt 100g…
|
||||
var omega_ratio = sum{z in ZUTATEN} menge[z]*werte[z,"Omega-6"]/sum{y in ZUTATEN} menge[y]*werte[z,"Omega-3"];
|
||||
var rezeptwert {s in STOFFE} = sum {z in ZUTATEN} menge[z]*werte[z,s];
|
||||
var total_weight = sum {z in ZUTATEN} menge[z]*bezugsmenge[z]/100; #je 100g
|
||||
var total_weight = sum {z in ZUTATEN} menge[z]*bezugsmenge[z];
|
||||
var total_pill_penalty = sum {z in ZUTATEN} max(menge[z]-pill_penalty[z,1],0)*pill_penalty[z,2];
|
||||
#Wenn die zutatenweise Obergrenze in pill_penalty[z,1] überschritten ist, werden Strafkosten für die Überschussmenge berechnet.
|
||||
|
||||
minimize gesamtpreis: kaufpreis*(1-weight_penalty) + total_weight*weight_penalty + total_pill_penalty;
|
||||
minimize gesamtpreis: kaufpreis*(1-weight_penalty) + total_weight/100*weight_penalty + total_pill_penalty;
|
||||
subject to ugrenze {s in STOFFE}: rezeptwert[s] >= minwert[s]; #undefined renders 0 => no problem here
|
||||
subject to ogrenze {s in STOFFE}: rezeptwert[s] <= maxwert[s]; #undefined should render Infinity here.
|
||||
subject to omega_ratio_constraint: omega_ratio <= 6;
|
||||
|
|
Loading…
Reference in a new issue