# foods[food] = (cost, f_min, f_max)
foods = {
"BEEF": (3.59, 2, 10),
"CHK": (2.59, 2, 10),
"FISH": (2.29, 2, 10),
"HAM": (2.89, 2, 10),
"MCH": (1.89, 2, 10),
"MTL": (1.99, 2, 10),
"SPG": (1.99, 2, 10),
"TUR": (2.49, 2, 10),
}
# nutrients[nutr] = (n_min, n_max)
nutrients = {
"A": (700, 20000),
"C": (700, 20000),
"B1": (700, 20000),
"B2": (700, 20000),
"NA": (0, 50000),
"CAL": (16000, 24000),
}
ampl.set["FOOD"] = list(foods.keys())
ampl.param["cost"] = {food: cost for food, (cost, _, _) in foods.items()}
ampl.param["f_min"] = {food: f_min for food, (_, f_min, _) in foods.items()}
ampl.param["f_max"] = {food: f_max for food, (_, _, f_max) in foods.items()}
ampl.set["NUTR"] = list(nutrients.keys())
ampl.param["n_min"] = {nutr: n_min for nutr, (n_min, _) in nutrients.items()}
ampl.param["n_max"] = {nutr: n_max for nutr, (_, n_max) in nutrients.items()}
amounts = [
[60, 8, 8, 40, 15, 70, 25, 60],
[20, 0, 10, 40, 35, 30, 50, 20],
[10, 20, 15, 35, 15, 15, 25, 15],
[15, 20, 10, 10, 15, 15, 15, 10],
[928, 2180, 945, 278, 1182, 896, 1329, 1397],
[295, 770, 440, 430, 315, 400, 379, 450],
]
ampl.param["amt"] = {
(nutrient, food): amounts[i][j]
for i, nutrient in enumerate(nutrients)
for j, food in enumerate(foods)
}