Skip to content

Commit 1f94f11

Browse files
committed
NON-DELAY SELESAI RIL NO FEK
NON-DELAY SELESAI RIL NO FEK
1 parent 9bb32af commit 1f94f11

24 files changed

+21
-8
lines changed

src/Non_delay.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def read_data():
1717

1818
# Pembacaan data mesin dari file dan exception handling
1919
try:
20-
mesin_file = open(f"test/Mesin.txt", "r")
20+
mesin_file = open(f"test2/Mesin.txt", "r")
2121
except:
2222
print(f"File Mesin.txt tidak ditemukan!")
2323
exit()
@@ -40,7 +40,7 @@ def read_data():
4040
for j in range(n_jobs):
4141
# Exception handling
4242
try:
43-
time_file = open(f"test/Job{j + 1}_Time.txt", "r")
43+
time_file = open(f"test2/Job{j + 1}_Time.txt", "r")
4444
except:
4545
print(f"File Job{j + 1}_Time.txt tidak ditemukan!")
4646
exit()
@@ -58,7 +58,7 @@ def read_data():
5858

5959
# Exception handling
6060
try:
61-
routing_file = open(f"test/Job{j + 1}_Routing.txt", "r")
61+
routing_file = open(f"test2/Job{j + 1}_Routing.txt", "r")
6262
except:
6363
print(f"File Job{j + 1}_Routing.txt tidak ditemukan!")
6464
exit()
@@ -118,7 +118,7 @@ def state_check():
118118
# Kalau tidak, kembalikan saja nilai st dari cj tersebut dalam sebuah list
119119
else:
120120
retval = [ST[CJ.index(min_c)]]
121-
121+
122122
# d. Melakukan indexing terhadap jadwal yang ada dan telah selesai
123123
for value in retval:
124124
i = ST.index(value)
@@ -161,7 +161,7 @@ def state_check():
161161
if i in index_job:
162162
ready_time = MESIN[0][ST[i][2] - 1]
163163
recent_rjx = RJ[i]
164-
if COPY_OF_ST[i][1] != len(COPY_OF_ST[0]):
164+
if COPY_OF_ST[i][1] != len(ROUTING[COPY_OF_ST[i][0] - 1]):
165165
if ready_time > recent_rjx:
166166
COPY_OF_CJ[i] = ready_time
167167
else :
@@ -180,14 +180,14 @@ def state_check():
180180
if (len(CJ) < len(COPY_OF_CJ)):
181181
for i in range(len(COPY_OF_CJ) - 1, -1, -1):
182182
# Proses penyesuaian dengan cj yang sudah baru dengan menghapus
183-
if i in index_job and COPY_OF_ST[i][1] == len(COPY_OF_ST[0]):
183+
if i in index_job and COPY_OF_ST[i][1] == len(ROUTING[COPY_OF_ST[i][0] - 1]):
184184
COPY_OF_CJ.pop(i)
185185
else :
186186
continue
187187

188188
# Penyalinan kembali nilai cj yang telah diperbaharui
189189
CJ = COPY_OF_CJ
190-
190+
191191
# j. Pembaharuan terhadap nilai rj
192192
RJ = [0 for i in range(len(ST))]
193193
for i in range (len(ST)):

test/Jadwal.txt renamed to test1/Jadwal.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
5, 1, 1, 3.7, 4.12
1212
6, 1, 1, 4.64, 5.31
1313
7, 1, 2, 8.58, 9.25
14-
7, 2, 7, 9.25, 9.75
14+
7, 2, 7, 9.25, 9.75
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)