model:
sets:
material/1..6/:amount,price;
nutrition/1..5/:lower,upper;
link(material,nutrition):percentage;
endsets
data:
percentage=
0.19 0.17 0.023 0.016 0.0007
0.082 0.022 0.036 0.0006 0.0022
0.11 0.076 0.017 0.0057 0.0012
0.048 0.09 0.072 0.048 0.027
0.115 0.119 0.038 0.0009 0.0011
0.48 0.028 0.005 0.0019 0.0019;
price=0.24 0.19 0.25 0.41 0.21 0.35;
lower=0.21 0.05 0.034 0.01 0.0045;
upper=0.4 0.25 0.1 0.0105 0.006;
enddata
min=@sum(material:amount*price);
@for(nutrition(j):@sum(material(i):amount(i)*percentage(i,j))>=lower(j));
@for(nutrition(j):@sum(material(i):amount(i)*percentage(i,j))<=upper(j));
@sum(material:amount)=1;
end
其中amount对应配料比例