From fcf4a3177a3239a9f05c4e6acae405c3df090c2d Mon Sep 17 00:00:00 2001 From: Wurzelkoch Date: Wed, 11 Dec 2019 10:40:23 +0100 Subject: [PATCH] kleiner Fehler --- Rezept.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rezept.mod b/Rezept.mod index 8ce0b0b..a175108 100644 --- a/Rezept.mod +++ b/Rezept.mod @@ -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;