Skip to content

Commit 008cc45

Browse files
committed
Fixing issue with Emax computation
1 parent 128d50b commit 008cc45

5 files changed

Lines changed: 30 additions & 10 deletions

File tree

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Current File",
9+
"type": "python",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal",
13+
"justMyCode": true
14+
}
15+
]
16+
}

build/lib/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

scheptk.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: scheptk
3-
Version: 0.0.8
3+
Version: 0.0.9
44
Summary: Python scheduling package
55
Home-page: https://github.com/framinan/scheptk
66
Author: Jose M Framinan

scheptk/scheptk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def Ejn(self, sequence):
242242

243243
# max earliness
244244
def Emax(self, sequence):
245-
return max(self.Lj(sequence))
245+
return max(self.Ej(sequence))
246246

247247
# flowtime (Cj - rj) of all jobs in a solution
248248
def Fj(self, solution):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name="scheptk",
14-
version="0.0.8",
14+
version="0.0.9",
1515
author="Jose M Framinan",
1616
author_email="framinan@us.es",
1717
description="Python scheduling package",

0 commit comments

Comments
 (0)