Wrap score-director config in ScoreDirectorFactoryConfig
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 37s
CI / test-go-edu-search (push) Successful in 29s
CI / test-python-klausur (push) Failing after 2m31s
CI / test-python-agent-core (push) Successful in 17s
CI / test-nodejs-website (push) Successful in 21s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 37s
CI / test-go-edu-search (push) Successful in 29s
CI / test-python-klausur (push) Failing after 2m31s
CI / test-python-agent-core (push) Successful in 17s
CI / test-nodejs-website (push) Successful in 21s
Timefold's SolverConfig expects a typed config object, not a dict — plain dicts hit AttributeError when the wrapper tries to materialise the Java side. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,7 @@ from concurrent.futures import ThreadPoolExecutor
|
|||||||
from timefold.solver import SolverFactory
|
from timefold.solver import SolverFactory
|
||||||
from timefold.solver.config import (
|
from timefold.solver.config import (
|
||||||
SolverConfig,
|
SolverConfig,
|
||||||
|
ScoreDirectorFactoryConfig,
|
||||||
TerminationConfig,
|
TerminationConfig,
|
||||||
Duration,
|
Duration,
|
||||||
)
|
)
|
||||||
@@ -38,7 +39,9 @@ _solver_factory = SolverFactory.create(
|
|||||||
SolverConfig(
|
SolverConfig(
|
||||||
solution_class=Timetable,
|
solution_class=Timetable,
|
||||||
entity_class_list=[Lesson],
|
entity_class_list=[Lesson],
|
||||||
score_director_factory_config={"constraint_provider_function": define_constraints},
|
score_director_factory_config=ScoreDirectorFactoryConfig(
|
||||||
|
constraint_provider_function=define_constraints,
|
||||||
|
),
|
||||||
termination_config=TerminationConfig(
|
termination_config=TerminationConfig(
|
||||||
spent_limit=Duration(seconds=settings.solver_seconds_limit),
|
spent_limit=Duration(seconds=settings.solver_seconds_limit),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user