$title The Farmer's Problem - Stochastic with NBD (FARMNDB,SEQ=100) $onText This model helps a farmer to decide how to allocate his or her land. The yields are uncertain. Here we use Lindo NBD algorithm and need to modify the model since Lindo's NDB algorithm requires that a RV occurs only once in the model. Birge, R, and Louveaux, F V, Introduction to Stochastic Programming. Springer, 1997. Contributor: Michael Ferris $offText * Only run for Lindo $ifI not "%gams.emp%"=="lindo" $exit Set crop / wheat, corn, sugarbeets / ch header for data table / yield yield in tons per acre cost plantcost on dollars per acre pprice crop seed purchase price in dollars per ton minreq minimum requirements of crop in ton to feed cattle / alias (c,crop); Table cd(crop,ch) crop data yield cost pprice minreq wheat 2.5 150 238 200 corn 3 230 210 240 sugarbeets 20 260 ; Parameter yf(crop) yield factor / #crop 1 / land available land in acres /500/; Set seq price curve segments / s1*s2 /; Table pricecurve(crop,seq,*) dollars per ton price ub wheat.s1 170 inf corn.s1 150 inf sugarbeets.s1 36 6000 sugarbeets.s2 10 inf ; set pcs(crop,seq) relevant segments; option pcs lindo.opt STOC_MAP_MPI2LP 1 STOC_METHOD 1 STOC_CALC_EVPI 0 $offEcho option emp = lindo; farm_emp.optfile = 1; solve farm_emp using emp maximizing profit scenario dict; display srep, s_yf;