Skip to content

Commit

Permalink
Fixing issue with Emax computation
Browse files Browse the repository at this point in the history
  • Loading branch information
framinan committed Oct 19, 2022
1 parent 128d50b commit 008cc45
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
}
]
}
18 changes: 11 additions & 7 deletions build/lib/scheptk/scheptk.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,20 @@ def Ejn(self, sequence):
def Emax(self, sequence):
return max(self.Lj(sequence))

# flowtime of all jobs in a solution
# flowtime (Cj - rj) of all jobs in a solution
def Fj(self, solution):
ct, job_order = self.ct(solution)
Cj = [max([ct[i][j] for i in range(len(ct))]) for j in range(len(job_order))]
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))]

ct, job_order = self.ct(solution)
return [max([ct[i][j] for i in range(len(ct))]) - self.r[job_order[j]] for j in range(len(job_order))]

# flowtime of all jobs according to a solution (natural order of the jobs)
# flowtime (Cj - rj) of all jobs according to a solution (natural order of the jobs)
def Fjn(self, solution):
return [self.Cjn(solution)[j] - self.Sjn(solution)[j] for j in range(self.jobs)]
ct, order = self.ct(solution)
cj = [max([ct[i][j] for i in range(len(ct))]) for j in range(len(order))]
fjn = [float('nan') for j in range(self.jobs)]
for j in range(len(order)):
fjn[order[j]] = cj[j] - self.r[j]

return fjn


# max flowtime
Expand Down
2 changes: 1 addition & 1 deletion scheptk.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: scheptk
Version: 0.0.8
Version: 0.0.9
Summary: Python scheduling package
Home-page: https://github.com/framinan/scheptk
Author: Jose M Framinan
Expand Down
2 changes: 1 addition & 1 deletion scheptk/scheptk.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def Ejn(self, sequence):

# max earliness
def Emax(self, sequence):
return max(self.Lj(sequence))
return max(self.Ej(sequence))

# flowtime (Cj - rj) of all jobs in a solution
def Fj(self, solution):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="scheptk",
version="0.0.8",
version="0.0.9",
author="Jose M Framinan",
author_email="framinan@us.es",
description="Python scheduling package",
Expand Down

0 comments on commit 008cc45

Please sign in to comment.