JobShopScheduling/src/SchedulingAlgorithms/enumerate.py

11 lines
338 B
Python

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[job])) )
begin = 0
solution = []
for task in schedule:
solution.append((begin, task))
begin += problem[task[0]][task[1]][0]
return solution