Skip to content

Commit f90543a

Browse files
committed
Adds handle method for cds choice in /solve
1 parent 71e2989 commit f90543a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,19 @@ def solve():
154154
)
155155
return response
156156

157+
elif pfsp_algorithm == "cds":
158+
seq, jobs, opt_makespan = problem_inst.genetic_algorithm()
159+
fig = jobs_to_gantt_fig(jobs, num_machines, num_jobs)
160+
graph_json = ganttfig_to_json(fig)
161+
resp = json.dumps(
162+
{"graph": graph_json, "optim_makespan": opt_makespan, "opt_seq": seq})
163+
response = app.response_class(
164+
response=resp,
165+
status=200,
166+
mimetype="application/json",
167+
)
168+
return response
169+
157170

158171
@app.route('/random', methods=["POST"])
159172
def random():

0 commit comments

Comments
 (0)