Skip to content

Commit 06efa58

Browse files
committed
Non-delay kelar puji Tuhan
Non-delay kelar puji Tuhan
1 parent 5213479 commit 06efa58

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

src/Non_delay.py

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,12 @@ def state_check(count):
146146
print("idx_job, idx_mach",index_job, index_mac)
147147

148148
COPY_OF_ST = [i for i in ST]
149+
COPY_OF_CJ = [i for i in CJ]
149150

150151
bias = 0
152+
153+
print("older cj, st",CJ, ST)
154+
print("len borth", len(CJ), len(COPY_OF_CJ))
151155

152156
for i, j in zip(index_job, index_mac):
153157
# Updating MESIN
@@ -164,24 +168,48 @@ def state_check(count):
164168
ST.pop(i - bias)
165169
CJ.pop(i - bias)
166170
bias += 1
171+
172+
# index_job1 = [ST.index(i) for i in COPY_OF_ST]
173+
""" index_job1 = []
174+
for i in COPY_OF_ST:
175+
try :
176+
index_job1.append(ST.index(i))
177+
except :
178+
continue """
167179

168-
print(len(ST))
169-
for i in range(len(ST)):
170-
if i in index_job:
171-
try:
180+
print("old cj, st",CJ, ST)
181+
# Updating the cj
182+
for i in range(len(COPY_OF_ST)):
183+
try:
184+
if i in index_job:
172185
ready_time = MESIN[0][ST[i][2] - 1]
173186
recent_rjx = RJ[i]
174-
print("rd, rcnt",ready_time, recent_rjx)
175-
if COPY_OF_ST[i][1] != 3:
187+
# print("rd, rcnt",ready_time, recent_rjx)
188+
if COPY_OF_ST[i][1] != len(COPY_OF_ST[0]):
176189
if ready_time > recent_rjx:
177-
CJ[i] = ready_time
190+
COPY_OF_CJ[i] = ready_time
178191
else :
179-
CJ[i] = recent_rjx
180-
except:
192+
COPY_OF_CJ[i] = recent_rjx
193+
else :
194+
print(i)
195+
print("mesin", MESIN[0][COPY_OF_ST[i][2] - 1])
196+
if (COPY_OF_CJ[i] <= MESIN[0][COPY_OF_ST[i][2] - 1]):
197+
COPY_OF_CJ[i] = MESIN[0][COPY_OF_ST[i][2] - 1]
198+
except:
199+
continue
200+
201+
print("latestcopy",COPY_OF_CJ)
202+
203+
if (len(CJ) < len(COPY_OF_CJ)):
204+
for i in range(len(COPY_OF_CJ) - 1, -1, -1):
205+
if i in index_job and COPY_OF_ST[i][1] == len(COPY_OF_ST[0]):
206+
print(i)
207+
COPY_OF_CJ.pop(i)
208+
else :
181209
continue
182-
else :
183-
CJ[i] += 1
184-
210+
211+
CJ = COPY_OF_CJ
212+
185213
print("cj, st", CJ, ST)
186214

187215
# Updating cj kalo overdua
@@ -191,7 +219,7 @@ def state_check(count):
191219
if retval[i] != TEMP_ST and count + 1 == CJ[ST.index(value)]:
192220
CJ[i] += 1 """
193221

194-
# Updating rj
222+
# Updating rj
195223
RJ = [0 for i in range(len(ST))]
196224
for i in range (len(ST)):
197225
RJ[i] = CJ[i] + TJ[i]

0 commit comments

Comments
 (0)