Spaces:
Paused
Paused
File size: 810 Bytes
3b9a6b5 2004c79 3b9a6b5 918bdb4 3b9a6b5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
from timefold.solver import SolverManager, SolverFactory, SolutionManager
from timefold.solver.config import (
SolverConfig,
ScoreDirectorFactoryConfig,
# TerminationConfig,
# Duration,
)
from .domain import *
from .constraints import define_constraints
solver_config: SolverConfig = SolverConfig(
solution_class=EmployeeSchedule,
entity_class_list=[Task],
score_director_factory_config=ScoreDirectorFactoryConfig(
constraint_provider_function=define_constraints
),
# termination_config=TerminationConfig(spent_limit=Duration(seconds=30)), # Commented out to allow unlimited solving time
)
solver_manager: SolverManager = SolverManager.create(
SolverFactory.create(solver_config)
)
solution_manager: SolutionManager = SolutionManager.create(solver_manager)
|