discrete_optimization.shop.fjsp.solvers package

Submodules

discrete_optimization.shop.fjsp.solvers.cpsat module

discrete_optimization.shop.fjsp.solvers.dp module

class discrete_optimization.shop.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
retrieve_solution(sol: Solution) → Solution[source]
set_warm_start(solution: AnyShopSolution) → None[source]

Make the solver warm start from the given solution.

discrete_optimization.shop.fjsp.solvers.lns_cpsat module

class discrete_optimization.shop.fjsp.solvers.lns_cpsat.FjspConstraintHandler(problem: FJobShopProblem, fraction_segment_to_fix: float = 0.9)[source]

Bases: OrtoolsCpSatConstraintHandler

adding_constraint_from_results_store(solver: CpSatShopSolver, result_storage: ResultStorage, result_storage_last_iteration: ResultStorage, **kwargs: Any) → Iterable[Constraint][source]

Add constraints to the internal model of a solver based on previous solutions

Parameters:
  • solver – solver whose internal model is updated

  • result_storage – all results so far

  • result_storage_last_iteration – results from last LNS iteration only

  • **kwargs

Returns:

list of added constraints

class discrete_optimization.shop.fjsp.solvers.lns_cpsat.NeighFjspConstraintHandler(problem: FJobShopProblem, neighbor_builder: NeighborBuilderSubPart)[source]

Bases: OrtoolsCpSatConstraintHandler

adding_constraint_from_results_store(solver: CpSatShopSolver, result_storage: ResultStorage, result_storage_last_iteration: ResultStorage, **kwargs: Any) → Iterable[Constraint][source]

Add constraints to the internal model of a solver based on previous solutions

Parameters:
  • solver – solver whose internal model is updated

  • result_storage – all results so far

  • result_storage_last_iteration – results from last LNS iteration only

  • **kwargs

Returns:

list of added constraints

class discrete_optimization.shop.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: AnyShopSolution, subtasks: set[Hashable] | None = None) → tuple[set[tuple[int, int]], set[tuple[int, int]]][source]

discrete_optimization.shop.fjsp.solvers.optal module

class discrete_optimization.shop.fjsp.solvers.optal.OptalFJspSolver(problem: FJobShopProblem, params_objective_function: ParamsObjectiveFunction | None = None, **kwargs: Any)[source]

Bases: SchedulingOptalSolver[tuple[int, int]]

get_task_interval(task: Task) → cp.IntervalVar[source]

Return interval variable for the task.

This variable corresponds to the task schedule, whatever the mode. This is the main optal variable (start, end and duration are derived from it)

If the task is optional, this interval should be also taken into account the presence/absence of the task.

init_model(**args: Any) → None[source]

Init cp model and reset stored variables if any.

problem: FJobShopProblem
retrieve_solution(solution: cp.Solution) → Solution[source]

Construct a d-o solution from OptalCP solver solution.

Parameters:

solution – OptalCP solution

Returns:

d-o solution

Module contents