File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,30 @@ def solve():
108108 mimetype = "application/json" ,
109109 )
110110 return response
111+ elif pfsp_algorithm == "neh" :
112+ seq , jobs , opt_makespan = problem_inst .neh_heuristic ()
113+ fig = jobs_to_gantt_fig (jobs , num_machines , num_jobs )
114+ graph_json = ganttfig_to_json (fig )
115+ resp = json .dumps (
116+ {"graph" : graph_json , "optim_makespan" : opt_makespan , "opt_seq" : seq })
117+ response = app .response_class (
118+ response = resp ,
119+ status = 200 ,
120+ mimetype = "application/json" ,
121+ )
122+ return response
123+ elif pfsp_algorithm == "bruteforce" :
124+ seq , jobs , opt_makespan = problem_inst .brute_force_exact ()
125+ fig = jobs_to_gantt_fig (jobs , num_machines , num_jobs )
126+ graph_json = ganttfig_to_json (fig )
127+ resp = json .dumps (
128+ {"graph" : graph_json , "optim_makespan" : opt_makespan , "opt_seq" : seq })
129+ response = app .response_class (
130+ response = resp ,
131+ status = 200 ,
132+ mimetype = "application/json" ,
133+ )
134+ return response
111135
112136
113137@app .route ('/random' , methods = ["POST" ])
You can’t perform that action at this time.
0 commit comments