You are on page 1of 2

E:\STUDY PHD\TERM 1- PHD\IMSE 7001 - OPTI MODELLING\ASG\2\HW2_1.

gms 29 Thng Chn 2015Page


22:15:01
1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

SETS
T number of towns /1*4/
;
PARAMETERS
X(T) x cordinate of towns
/1 10
2 60
3 40
4 80/
Y(T) y cordinate of towns
/1 20
2 20
3 30
4 60/
F average number of fires in towns each year
/1 20
2 30
3 40
4 25/;

POSITIVE
E(T) for
W(T) for
N(T) for
S(T) for
;

VARIABLES
east distance
west distance
north distnace
south distance

FREE VARIABLES
OBJ objective
LX x cordinate of station location
LY y cordinate of station location
;

EQUATION OBJECTIVE minimize travel distance;


OBJECTIVE.. OBJ =E= SUM(T,F(T)*(E(T) + W(T) + N(T) + S(T)));
EQUATION CS1_X(T) x distance;
CS1_X(T).. LX - X(T) =E= E(T) - W(T);
EQUATION CS2_Y(T) y distance;
CS2_Y(T).. LY - Y(T) =E= N(T) - S(T);

MODEL HW2_1 /ALL/;


OPTION LP=CPLEX;
SOLVE HW2_1 using LP minimizing OBJ;

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


22:15:01
2

56
57
58

You might also like