Skip to content

Commit 128d50b

Browse files
committed
Changes in Fj and Fjn
1 parent 30619b5 commit 128d50b

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed
7.15 KB
Binary file not shown.
122 Bytes
Binary file not shown.
776 Bytes
Binary file not shown.

scheptk/scheptk.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,20 @@ def Ejn(self, sequence):
244244
def Emax(self, sequence):
245245
return max(self.Lj(sequence))
246246

247-
# flowtime of all jobs in a solution
247+
# flowtime (Cj - rj) of all jobs in a solution
248248
def Fj(self, solution):
249-
ct, job_order = self.ct(solution)
250-
Cj = [max([ct[i][j] for i in range(len(ct))]) for j in range(len(job_order))]
251-
return [Cj[j] - min([ct[i][j] - self.pt[i][job_order[j]] for i in range(len(ct))]) for j in range(len(job_order))]
252-
249+
ct, job_order = self.ct(solution)
250+
return [max([ct[i][j] for i in range(len(ct))]) - self.r[job_order[j]] for j in range(len(job_order))]
253251

254-
# flowtime of all jobs according to a solution (natural order of the jobs)
252+
# flowtime (Cj - rj) of all jobs according to a solution (natural order of the jobs)
255253
def Fjn(self, solution):
256-
return [self.Cjn(solution)[j] - self.Sjn(solution)[j] for j in range(self.jobs)]
254+
ct, order = self.ct(solution)
255+
cj = [max([ct[i][j] for i in range(len(ct))]) for j in range(len(order))]
256+
fjn = [float('nan') for j in range(self.jobs)]
257+
for j in range(len(order)):
258+
fjn[order[j]] = cj[j] - self.r[j]
259+
260+
return fjn
257261

258262

259263
# max flowtime

0 commit comments

Comments
 (0)