File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 14
14
from __future__ import annotations
15
15
16
16
import multiprocess
17
+ from dataclasses import asdict
17
18
from typing import TYPE_CHECKING , Any
18
19
19
20
import diskcache
@@ -355,16 +356,16 @@ def run_optimization(
355
356
solver_type = SolverType (solver )
356
357
357
358
if solver_type is SolverType .CQM :
358
- cqm = employee_scheduling .build_cqm (params )
359
+ cqm = employee_scheduling .build_cqm (** asdict ( params ) )
359
360
360
361
feasible_sampleset , errors = employee_scheduling .run_cqm (cqm )
361
362
sample = feasible_sampleset .first .sample
362
363
363
364
sched = utils .build_schedule_from_sample (sample , employees )
364
365
365
366
elif solver_type is SolverType .NL :
366
- model , assignments = employee_scheduling .build_nl (params )
367
- errors = employee_scheduling .run_nl (model , assignments , params )
367
+ model , assignments = employee_scheduling .build_nl (** asdict ( params ) )
368
+ errors = employee_scheduling .run_nl (model , assignments , ** asdict ( params ) )
368
369
sched = utils .build_schedule_from_state (assignments .state (), employees , shifts )
369
370
370
371
else :
You can’t perform that action at this time.
0 commit comments