enumerate tasks

This commit is contained in:
Maximilian Schlosser 2017-07-02 14:07:38 +02:00
parent 3aed7f52f5
commit 23e6d12754
3 changed files with 8 additions and 10 deletions

4
inputdata/sample Normal file
View 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

View file

@ -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

View file

@ -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 ]