ReportPrinter Report.pdf

  • Upload
    npnbkck

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

  • E:\STUDY PHD\TERM 1- PHD\IMSE 7001 - OPTI MODELLING\ASG\2\HW2_1.gms 29 Thng Chn 2015 22:15:01Page 1

    1 SETS

    2 T number of towns /1*4/

    3 ;

    4

    5 PARAMETERS

    6 X(T) x cordinate of towns

    7 /1 10

    8 2 60

    9 3 40

    1 0 4 80/

    1 1

    1 2 Y(T) y cordinate of towns

    1 3 /1 20

    1 4 2 20

    1 5 3 30

    1 6 4 60/

    1 7

    1 8 F average number of fires in towns each year

    1 9 /1 20

    2 0 2 30

    2 1 3 40

    2 2 4 25/;

    2 3

    2 4

    2 5 POSITIVE VARIABLES

    2 6 E(T) for east distance

    2 7 W(T) for west distance

    2 8 N(T) for north distnace

    2 9 S(T) for south distance

    3 0 ;

    3 1

    3 2

    3 3 FREE VARIABLES

    3 4 O B J objective

    3 5 L X x cordinate of station location

    3 6 L Y y cordinate of station location

    3 7 ;

    3 8

    3 9

    4 0 EQUATION O B J E C T I V E minimize travel distance;

    4 1 OBJECTIVE.. OBJ =E= SUM(T,F(T)*(E(T) + W(T) + N(T) + S(T)));

    4 2

    4 3 EQUATION CS1_X(T) x distance;

    4 4 CS1_X(T).. LX - X(T) =E= E(T) - W(T);

    4 5

    4 6 EQUATION CS2_Y(T) y distance;

    4 7 CS2_Y(T).. LY - Y(T) =E= N(T) - S(T);

    4 8

    4 9

    5 0 MODEL HW2_1 /ALL/;

    5 1

    5 2 OPTION LP=CPLEX;

    5 3

    5 4 SOLVE HW2_1 using LP minimizing OBJ;

    5 5

  • E:\STUDY PHD\TERM 1- PHD\IMSE 7001 - OPTI MODELLING\ASG\2\HW2_1.gms 29 Thng Chn 2015 22:15:01Page 2

    5 6

    5 7

    5 8