solve by enumeration

This commit is contained in:
Maximilian Schlosser 2017-06-29 19:14:24 +02:00
parent ba91f321e2
commit e3945ce3dc
3 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,10 @@
from JobShopParser 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])) ]
begin = 0
solution = []
for task in schedule:
solution.append((begin, task))
begin += problem.problem_data[task[0]][task[1]][0]
print(solution)

View file

@ -0,0 +1,6 @@
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 ]

View file