Skip to content

Commit 70fb17c

Browse files
committed
Updating the Non-delay
Updating the Non-delay
1 parent 93f3efc commit 70fb17c

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/Non_delay.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ def state_check():
145145
# Updating MESIN
146146
MESIN[0][j] = RJ[i]
147147
try:
148+
# Updating cj
149+
CJ[i] += RJ[i]
148150
# Updating tj
149151
TJ[i] = PROCESSING_TIME[ST[i][0] - 1][ST[i][1]]
150152
# Updating st
@@ -154,17 +156,22 @@ def state_check():
154156
ST.pop(i - bias)
155157
CJ.pop(i - bias)
156158
bias += 1
157-
159+
160+
print("bias",bias)
158161
# Updating cj
159162
# retval = [3, 1, 3] mewakili job3, yang1, mesin3
160-
CJ[retval[0][0] - 1] += RJ[retval[0][0] - 1]
161-
TJ[retval[0][0] - 1] = PROCESSING_TIME[retval[0][0] - 1][ST[retval[0][0] - 1][1] - 1]
163+
""" CJ[retval[0][0] - 1] += RJ[retval[0][0] - 1]
164+
TJ[retval[0][0] - 1] = PROCESSING_TIME[retval[0][0] - 1][ST[retval[0][0] - 1][1] - 1] """
162165
# ST[retval[0][0] - 1][1] += 1
163-
RJ = [0 for i in range(len(ROUTING))]
164-
for i in range (len(ROUTING)):
166+
""" print("cj",CJ)
167+
print("tj",TJ)
168+
# print("rj",RJ)
169+
print("st",ST) """
170+
RJ = [0 for i in range(len(ST))]
171+
for i in range (len(ST)):
165172
RJ[i] = CJ[i] + TJ[i]
166173

167-
return retval
174+
return ST
168175

169176
# Print makeform and schedule to string form in the console
170177
def print_schedule(schedule=SCHEDULE, lateness=None):
@@ -195,10 +202,10 @@ def print_schedule(schedule=SCHEDULE, lateness=None):
195202
print("r",ROUTING)
196203
print("m",MESIN)
197204
# state_check()
198-
while state_check() != None:
205+
while state_check() != []:
199206
pass
200207
print('---- Semua job telah selesai ----')
201-
# print_schedule()
208+
print_schedule()
202209
# cj, tj, rj, st = state_check()
203210
""" print("Hasil state check")
204211
print("cj", cj)

0 commit comments

Comments
 (0)