# Set of crops; set C; # Set of scenarios set S; # probability of scenario s param p{S}; # Number of acres of crop c to plant param x{C} >= 0; # Tons of crop c sold at most favorable price var w{C,S} >= 0; # Tons of crop c sold at unfavorable price var e{C,S} >= 0; # Tons of crop c purchased var y{C,S} >= 0; param Yield{C,S}; param PlantingCost{C}; param SalePrice{C}; # This is the *favorable* sales price param MaxAtGoodPrice{C} default Infinity; param LowSalePrice{C} default 0; param PurchasePrice{C} default 10000; param MinReq{C} default 0; param TotalAcres; param MinProfit; let MinProfit := 58000; maximize Profit: sum{c in C, s in S} p[s] * SalePrice[c] * w[c,s] + sum{c in C, s in S} p[s] * LowSalePrice[c] * e[c,s] - sum{c in C} PlantingCost[c] * x[c] - sum{c in C, s in S} p[s] * PurchasePrice[c] * y[c,s]; subject to Land: sum{c in C} x[c] <= TotalAcres; subject to YieldDef{c in C, s in S}: Yield[c,s] * x[c] + y[c,s] - w[c,s] - e[c,s] - MinReq[c] = 0; subject to QuotaRestrict{c in C, s in S}: w[c,s] <= MaxAtGoodPrice[c]; subject to ProfitMinimmum{s in S}: sum{c in C} SalePrice[c] * w[c,s] + sum{c in C} LowSalePrice[c] * e[c,s] - sum{c in C} PlantingCost[c] * x[c] - sum{c in C} PurchasePrice[c] * y[c,s] >= MinProfit;