| | Input: Operation chromosome, Process time chromosome, Machine chromosome; |
| | Output: Makespan; |
| (1) | for (i ← 1; i ≤ length of operation chromosome; i++) |
| (2) | Case 1 (Oi belongs to O_leaf) |
| (3) | if (O_counter = 1) |
| (4) | if (M_counter = 1)//Figure 8-① |
| (5) | Si = 0; |
| (6) | else//Figure 8-② |
| (7) | Si = E_mb; |
| (8) | end if |
| (9) | else |
| (10) | if (M_counter = 1)//Figure 8-③ |
| (11) | Si = E_ob; |
| (12) | else//Figure 8-④ |
| (13) | Si = max (E_mb, E_ob) |
| (14) | end if |
| (15) | end if |
| (16) | Ei = Si + Pi; |
| (17) | Case 2 (Oi does not belong to O_leaf) |
| (18) | if (O_counter = 1) |
| (19) | if (M_counter = 1) |
| (20) | if (Oi does not has immediate predecessor operation)//Figure 8-⑤-1 |
| (21) | Si = 0; |
| (22) | else//Figure 8-⑤-2 |
| (23) | Si = E_opre; |
| (24) | end if |
| (25) | else |
| (26) | if (Oi does not has immediate predecessor operation) |
| (27) | if (Oi cannot be inserted forward)//Figure 8-⑥-1, Figure 8-⑥-2 |
| (28) | Si = E_mb; |
| (29) | else//Figure 8-⑥-3 |
| (30) | Si = the starting point of the idle time that can be inserted; |
| (31) | end if |
| (32) | else//Figure 8-⑥-4 |
| (33) | Si = max (E_mb, E_opre); |
| (34) | end if |
| (35) | end if |
| (36) | else |
| (37) | if (Oi does not belong to No-wait) |
| (38) | if (M_counter = 1)//Figure 8-⑦ |
| (39) | Si = E_ob (or E_opre); |
| (40) | else//Figure 8-⑧ |
| (41) | Si = max (E_mb, E_ob (or E_opre)); |
| (42) | end if |
| (43) | else |
| (44) | if (Oi belongs to uniline No-wait) |
| (45) | if (M_counter = 1)//Figure 8-⑨-1 |
| (46) | Si = E_ob (or E_opre); |
| (47) | else//Figure 8-⑨-2 |
| (48) | Si = max (E_mb, E_ob (or E_opre)); |
| (49) | Ei−1 = Si; |
| (50) | Si−1 = Ei−1 − Pi−1; |
| (51) | end if |
| (52) | else |
| (53) | if (M_counter = 1)//Figure 8-⑩-1 |
| (54) | Si = max (E_ob, E_opre); |
| (55) | if (E_ob < E_opre) |
| (56) | Ei−1 = Si; |
| (57) | Si−1 = Ei−1 − Pi−1; |
| (58) | end if |
| (59) | else//Figure 8-⑩-2 |
| (60) | Si = max (E_mb, E_ob, E_opre); |
| (61) | if (E_ob < E_opre ||E_ob < E_opre) |
| (62) | Ei−1 = Si; |
| (63) | Si−1 = Ei−1 − Pi−1; |
| (64) | end if |
| (65) | end if |
| (66) | end if |
| (67) | end if |
| (68) | end if |
| (69) | Ei = Si + Pi; |
| (70) | end for |
| (71) | |