-
Notifications
You must be signed in to change notification settings - Fork 0
/
HConstrutiva.txt
103 lines (93 loc) · 1.64 KB
/
HConstrutiva.txt
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#heurística construtiva
#ordem decrescente de w
for{e in E}{
for{b in L}{
if Q[e,b]==1 then{
let Re[e]:=r[b];
let pe[e]:=Pd[b];
};
}
}
for {z in E}{
let auxDecW[z]:=w[z]*((Re[z]+pe[z])/d[z]);
}
for {a in E}{
let auxmax:=0;
for {b in E}{
if auxDecW[b]>=auxmax then {
let auxmax := auxDecW[b];
let auxid := b;
};
}
let DecW[a]:= auxDecW[auxid];
let ODecW[a]:=auxid;
let auxDecW[auxid]:= -1;
}
##atribuir as maquinas de descarga e carga a ordem decrescente de W
for {a in E}{
let auxODecW[a]:=ODecW[a];
}
for { k in K}{
let auxC:=0;
repeat while (auxC + v[auxid] <= C[k] && sum{f in E} auxODecW[f]<>0){
let auxe:=auxe+1;
let auxid:=auxODecW[auxe];
let auxC:=auxC+v[auxid];
let auxODecW[auxe]:=0;
};
}
## calcular tempo de atraso
for {a in E}{
for{l in L}{
if Q[a,l]>0 then {
let Re[a]:=r[l];
let pe[a]:=Pd[l];
}
}
}
let auxe:=1;
for {a in E}{
let auxODecW[a]:=ODecW[a];
}
for {a in E}{
let auxid:=auxODecW[a];
if UT[auxe]<Re[auxid] then{
let UT[auxid]:=Re[auxid]+pe[auxid];
}
else {
let UT[auxid]:=UT[auxe]+pe[auxid];
}
let auxe:=auxid;
}
for {b in L}{
for {k in K}{
if S[b,k]==1 then{
let DT[b]:=UT[b]+Pc[k];
let aux:= DT[b]-d[b];
if aux>0 then{
let t[b]:=aux;
}
}
}
}
for {a in E}{
let soma:= t[a]*w[a]+soma;
}
printf"\nsequencia dos pordutos\nOw";
for {a in E}{
printf" %d ", ODecW[a];
}
printf"\nDt";
for {a in E}{
printf" %d ", DT[a];
}
printf"\nS[L,k]";
for {a in L}{
printf"\n";
for {k in K}{
printf" %d ",S[a,k];
}
}
#display X;
printf"\n fo: %d \n", soma;
end;