This shows you the differences between two versions of the page.
— |
gams:a_gams_implementation_of_the_example_model_mentioned_in_an_overview_of_genetic_algorithms_for_the_solution_of_optimisation_problems [2007/09/27 05:08] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== A MINLP GAMS implementation of the example model mentioned in "An overview of genetic algorithms for the solution of optimisation problems" ====== | ||
+ | <code> | ||
+ | $ontext | ||
+ | An overview of genetic algorithms for the solution of optimisation problems | ||
+ | Simon Mardle and Sean Pascoe | ||
+ | University of Portsmouth | ||
+ | |||
+ | http://www.economicsnetwork.ac.uk/cheer/ch13_1/ch13_1p16.htm | ||
+ | $offtext | ||
+ | |||
+ | Set i boat class /i1*i3/ | ||
+ | j fish species /j1*j3/ | ||
+ | |||
+ | Parameter | ||
+ | P(j) Price of fish species j / j1 2.5, j2 2, j3 1.5 / | ||
+ | F(i) Fixed Costs of boat class i / i1 1, i2 0.8, i3 0.8 / | ||
+ | V(i) Variable Costs of boat class i / i1 0.01, i2 0.008, i3 0.008 / | ||
+ | K(j) Carrying capacity of fish species j / j1 2000, j2 2500, j3 4000 / | ||
+ | R(j) Growth rate of fish species j / j1 0.1, j2 0.5, j3 0.3 / | ||
+ | ue(i) upper bound on effort / i1 275, i2 160, i3 200 /; | ||
+ | |||
+ | Table Q(i,j) Catchability coefficient of fish species j by boat class i | ||
+ | j1 j2 j3 | ||
+ | i1 0.0002 0.0001 | ||
+ | i2 0.0002 0.00005 | ||
+ | i3 0.0002 | ||
+ | ; | ||
+ | |||
+ | Variable | ||
+ | z profit | ||
+ | xb(i) boats | ||
+ | xe(i) effort | ||
+ | xf(j) fishing mortality | ||
+ | xc(j) catch | ||
+ | xl(j) landings; | ||
+ | Positive Variables xe,xf,xc,xl; | ||
+ | Integer Variables xb; | ||
+ | |||
+ | Equation | ||
+ | obj revenue from landings minus the fixed and variable costs of the fishing | ||
+ | e1(j) fishing mortality | ||
+ | e2(j) evaluates catch from this fishing mortality rate | ||
+ | e3(j) constrains landings to be no greater than catch; | ||
+ | |||
+ | obj.. z =e= sum(j, P(j)*xl(j)) - sum(i, F(i)*xb(i) + V(i)*xe(i)*xb(i)); | ||
+ | e1(j).. xf(j) =e= sum(i, Q(i,j)*xe(i)*xb(i)); | ||
+ | e2(j).. xc(j) =e= K(j)*xf(j) - K(j)/R(j)*sqr(xf(j)); | ||
+ | e3(j).. xl(j) =l= xc(j); | ||
+ | |||
+ | model fish /all/; | ||
+ | option optcr=0; | ||
+ | xe.up(i) = ue(i); | ||
+ | xl.up(j) = 500; | ||
+ | |||
+ | xb.l(i)=uniform(1,10); | ||
+ | xe.l(i)=uniform(100,200); | ||
+ | |||
+ | solve fish max z using rminlp; | ||
+ | fish.optcr=0; | ||
+ | solve fish max z using minlp; | ||
+ | </code> |