-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrouteplanning.run
More file actions
88 lines (71 loc) · 1.5 KB
/
routeplanning.run
File metadata and controls
88 lines (71 loc) · 1.5 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#reset;
option times 2;
option solver cplex;
#option knitro_options 'outlev=1';
#option solver ilogcp;
model routeplanning.mod;
data routeplanning.dat;
#set to 1 edges of the graph (grid)
for {i in 1..n}
{
#right
if (i mod 5 != 0) then
{
let t[i,i+1]:=1;
let t[i+1,i]:=1;
}
#left
if (i mod 5 != 1) then
{
let t[i,i-1]:=1;
let t[i-1,i]:=1;
}
#up
if (i>5) then
{
let t[i,i-5]:=1;
let t[i-5,i]:=1;
}
#down
if (i<21) then
{
let t[i,i+5]:=1;
let t[i+5,i]:=1;
}
}
#set failed tracks 1 over 10 probability of being failed
for {i in 1..n}
{
for {j in 1..n}
{
if (t[i,j] == 1) then
{
if (ceil(Uniform(1,10))<=2) then let F[i,j]:=1;
}
}
}
#set destination and location of each vehicle
for {i in 1..u}
{
#let location[i]:=ceil(Uniform(1,n));
#let destination[i]:=ceil(Uniform(1,n));
#repeat while destination[i]==location[i]
#{
# let destination[i]:=ceil(Uniform(1,n));
#}
}
#data test.dat;
solve;
#print _slogconname[1];
#print _scon[1];
display {j in K, s in Q, d in Q: x[1,j,s,d]>0} x[1,j,s,d];
display {j in K, s in Q, d in Q: x[2,j,s,d]>0} x[2,j,s,d];
display {j in K, s in Q, d in Q: x[3,j,s,d]>0} x[3,j,s,d];
display {j in K, s in Q, d in Q: x[4,j,s,d]>0} x[4,j,s,d];
#display {j in K, s in Q, d in Q: uxu[1,j,s,d]>0} uxu[1,j,s,d];
#display {j in K, s in Q, q in Q, d in Q: uxu2[1,j,s,q,d]>0} uxu2[1,j,s,q,d];
display gamma;
display {i in Q, j in Q: F[i,j]==1} F[i,j];
#display {i in Q, j in Q: t[i,j]==1} t[i,j];
display location;
display destination;