enumerate tasks
This commit is contained in:
parent
3aed7f52f5
commit
23e6d12754
4
inputdata/sample
Normal file
4
inputdata/sample
Normal file
|
@ -0,0 +1,4 @@
|
|||
3 3
|
||||
0 4 1 6 2 1
|
||||
1 3 0 13 2 4
|
||||
1 2 2 5 0 3
|
|
@ -1,10 +1,10 @@
|
|||
from JobShopParser import JobShopProblem as Problem
|
||||
from Parser import JobShopProblem as Problem
|
||||
|
||||
def enumerate(problem):
|
||||
schedule = [ (job, task) for job in range(0, problem.jobs) for task in range(0, len(problem.problem_data[job])) ]
|
||||
schedule = ( (job, task) for job in range(0, problem.jobs) for task in range(0, len(problem[job])) )
|
||||
begin = 0
|
||||
solution = []
|
||||
for task in schedule:
|
||||
solution.append((begin, task))
|
||||
begin += problem.problem_data[task[0]][task[1]][0]
|
||||
print(solution)
|
||||
begin += problem[task[0]][task[1]][0]
|
||||
return solution
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
from JobShopParser import *
|
||||
|
||||
def lpt(problem : JobShopProblem):
|
||||
while problem:
|
||||
ready = [ job[0] for job in problem.problem_data ]
|
||||
req_machines = [ task[1] for task in ready ]
|
Loading…
Reference in a new issue