Flowshop sample#
We start by importing the corresponding jobshop problem module as following :
[1]:
%load_ext autoreload
%autoreload 2
import pyscheduling.FS.FmCmax as fs
We can either import the instance from a text file or randomly generate it.
[2]:
instance = fs.FmCmax_Instance.generate_random(5,2)
instance.to_txt("deleteMe.txt")
Finally, we use one of the implemented methods which are found in either Heuristics or Metaheuristics classes as following :
[3]:
solution = fs.Heuristics.slope(instance)
print(solution)
Search stopped with status : FEASIBLE
Solution is :
Objective : 100
Jobs sequence : 0 3 2 1 4
Machine_ID | Job_schedule (job_id , start_time , completion_time) | Completion_time
(0, 0, 4) : (3, 4, 14) : (2, 14, 25) : (1, 25, 43) : (4, 43, 75) | 75
(0, 4, 34) : (3, 34, 66) : (2, 66, 85) : (1, 85, 97) : (4, 97, 100) | 100
Runtime is : 4.9900000007596645e-05s
time to best is : -1s