From 23e6d12754d4f54e37dedf027663997431a62b19 Mon Sep 17 00:00:00 2001 From: Maximilian Schlosser Date: Sun, 2 Jul 2017 14:07:38 +0200 Subject: [PATCH] enumerate tasks --- inputdata/sample | 4 ++++ src/SchedulingAlgorithms/enumerate.py | 8 ++++---- src/SchedulingAlgorithms/lpt.py | 6 ------ 3 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 inputdata/sample delete mode 100644 src/SchedulingAlgorithms/lpt.py diff --git a/inputdata/sample b/inputdata/sample new file mode 100644 index 0000000..0ace874 --- /dev/null +++ b/inputdata/sample @@ -0,0 +1,4 @@ +3 3 +0 4 1 6 2 1 +1 3 0 13 2 4 +1 2 2 5 0 3 diff --git a/src/SchedulingAlgorithms/enumerate.py b/src/SchedulingAlgorithms/enumerate.py index 7b50a9c..558ea12 100644 --- a/src/SchedulingAlgorithms/enumerate.py +++ b/src/SchedulingAlgorithms/enumerate.py @@ -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 diff --git a/src/SchedulingAlgorithms/lpt.py b/src/SchedulingAlgorithms/lpt.py deleted file mode 100644 index 70eeb01..0000000 --- a/src/SchedulingAlgorithms/lpt.py +++ /dev/null @@ -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 ]