From e3945ce3dce412eb4e8ae7a752504d55def67a96 Mon Sep 17 00:00:00 2001 From: Maximilian Schlosser Date: Thu, 29 Jun 2017 19:14:24 +0200 Subject: [PATCH] solve by enumeration --- src/SchedulingAlgorithms/enumerate.py | 10 ++++++++++ src/SchedulingAlgorithms/lpt.py | 6 ++++++ src/SchedulingAlgorithms/simanneal.py | 0 3 files changed, 16 insertions(+) create mode 100644 src/SchedulingAlgorithms/enumerate.py create mode 100644 src/SchedulingAlgorithms/lpt.py create mode 100644 src/SchedulingAlgorithms/simanneal.py diff --git a/src/SchedulingAlgorithms/enumerate.py b/src/SchedulingAlgorithms/enumerate.py new file mode 100644 index 0000000..7b50a9c --- /dev/null +++ b/src/SchedulingAlgorithms/enumerate.py @@ -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) diff --git a/src/SchedulingAlgorithms/lpt.py b/src/SchedulingAlgorithms/lpt.py new file mode 100644 index 0000000..70eeb01 --- /dev/null +++ b/src/SchedulingAlgorithms/lpt.py @@ -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 ] diff --git a/src/SchedulingAlgorithms/simanneal.py b/src/SchedulingAlgorithms/simanneal.py new file mode 100644 index 0000000..e69de29