discrete_optimization.fjsp.solvers package
Submodules
discrete_optimization.fjsp.solvers.cpsat module
- class discrete_optimization.fjsp.solvers.cpsat.CpSatFjspSolver(problem: FJobShopProblem, **kwargs: Any)[source]
Bases:
OrtoolsCpSatSolver
,WarmstartMixin
- hyperparameters: list[Hyperparameter] = [CategoricalHyperparameter(name='duplicate_temporal_var', default=False, depends_on=None, name_in_kwargs='duplicate_temporal_var'), CategoricalHyperparameter(name='add_cumulative_constraint', default=False, depends_on=None, name_in_kwargs='add_cumulative_constraint')]
Hyperparameters available for this solver.
- These hyperparameters are to be feed to **kwargs found in
__init__()
init_model() (when available)
solve()
- init_model(**args: Any) None [source]
Instantiate a CP model instance
Afterwards, self.instance should not be None anymore.
- problem: FJobShopProblem
- retrieve_solution(cpsolvercb: CpSolverSolutionCallback) Solution [source]
Construct a do solution from the cpsat solver internal solution.
It will be called each time the cpsat solver find a new solution. At that point, value of internal variables are accessible via cpsolvercb.Value(VARIABLE_NAME).
- Parameters:
cpsolvercb – the ortools callback called when the cpsat solver finds a new solution.
- Returns:
the intermediate solution, at do format.
- set_warm_start(solution: FJobShopSolution) None [source]
Make the solver warm start from the given solution.
discrete_optimization.fjsp.solvers.dp module
- class discrete_optimization.fjsp.solvers.dp.DpFjspSolver(problem: Problem, params_objective_function: ParamsObjectiveFunction | None = None, **kwargs: Any)[source]
Bases:
DpSolver
,WarmstartMixin
- hyperparameters: list[Hyperparameter] = [CategoricalHyperparameter(name='solver', default=<class 'builtins.CABS'>, depends_on=None, name_in_kwargs='solver'), CategoricalHyperparameter(name='add_penalty_on_inefficiency', default=True, depends_on=None, name_in_kwargs='add_penalty_on_inefficiency')]
Hyperparameters available for this solver.
- These hyperparameters are to be feed to **kwargs found in
__init__()
init_model() (when available)
solve()
- init_model(**kwargs: Any) None [source]
Initialize internal model used to solve.
Can initialize a ortools, milp, gurobi, … model.
- problem: FJobShopProblem
- set_warm_start(solution: FJobShopSolution) None [source]
Make the solver warm start from the given solution.
discrete_optimization.fjsp.solvers.lns_cpsat module
- class discrete_optimization.fjsp.solvers.lns_cpsat.FjspConstraintHandler(problem: FJobShopProblem, fraction_segment_to_fix: float = 0.9)[source]
Bases:
OrtoolsCpSatConstraintHandler
- adding_constraint_from_results_store(solver: CpSatFjspSolver, result_storage: ResultStorage, **kwargs: Any) Iterable[Constraint] [source]
- class discrete_optimization.fjsp.solvers.lns_cpsat.NeighFjspConstraintHandler(problem: FJobShopProblem, neighbor_builder: NeighborBuilderSubPart)[source]
Bases:
OrtoolsCpSatConstraintHandler
- adding_constraint_from_results_store(solver: CpSatFjspSolver, result_storage: ResultStorage, **kwargs: Any) Iterable[Constraint] [source]
- class discrete_optimization.fjsp.solvers.lns_cpsat.NeighborBuilderSubPart(problem: FJobShopProblem, nb_cut_part: int = 10)[source]
Bases:
object
Cut the schedule in different subpart in the increasing order of the schedule.
- find_subtasks(current_solution: FJobShopSolution, subtasks: set[Hashable] | None = None) tuple[set[tuple[int, int]], set[tuple[int, int]]] [source]