discrete_optimization.shop.transformations package

Submodules

discrete_optimization.shop.transformations.to_generic_scheduling module

Transformation from CommonShopProblem (JSP/FJSP/OSP) to GenericSchedulingImpl.

class discrete_optimization.shop.transformations.to_generic_scheduling.ShopToGenericSchedulingTransformation[source]

Bases: ToGenericSchedulingImpl[CommonShopProblem, AnyShopSolution]

Transform CommonShopProblem to GenericSchedulingImplProblem.

This transformation works for JSP, FJSP, and OSP problems: - JSP: Single mode per task (one recipe per subjob) - FJSP: Multiple modes per task (multiple recipe options per subjob) - OSP: Single mode per task, no precedence constraints

Mapping: - Tasks: (job_index, subjob_index) tuples - Modes: Recipe options for each subjob - Cumulative resources: Machines (capacity 1 each) - Precedence: From problem’s get_precedence_constraints() - No-overlap: Tasks within same job (from get_no_overlap())

transform_solution_from_raw_generic_to_specific(raw_sol: RawSolution[tuple[int, int], Hashable, Hashable], source_problem: CommonShopProblem) AnyShopSolution[source]

Convert a raw solution (from generic problem) into a specific solution to the source problem.

Parameters:

source_problem

Returns:

discrete_optimization.shop.transformations.to_generic_scheduling.transform_solution_from_raw_generic_to_shop(raw_sol: RawSolution[tuple[int, int], Hashable, Hashable], problem: CommonShopProblem) AnyShopSolution[source]

discrete_optimization.shop.transformations.to_rcpsp_multimode module

Transformation from CommonShopProblem (JSP/FJSP/OSP) to multimode RCPSP.

class discrete_optimization.shop.transformations.to_rcpsp_multimode.ShopToRcpspMultimodeTransformation[source]

Bases: ProblemTransformation[CommonShopProblem, AnyShopSolution, RcpspProblem, RcpspSolution]

Transform CommonShopProblem to multimode RCPSP.

This transformation works for JSP, FJSP, and OSP problems: - JSP: Single mode per task (one recipe per subjob) - FJSP: Multiple modes per task (multiple recipe options per subjob) - OSP: Single mode per task, no precedence constraints

Mapping: - (job_j, subjob_k) → task_{j}_{k} - Recipe options → modes for each task - Machines → renewable resources (capacity 1) - Processing time on machine → duration for that mode - Job precedence + no-overlap constraints → task successors and constraints

back_transform_solution(solution: RcpspSolution, source_problem: CommonShopProblem) AnyShopSolution[source]

Transform RCPSP solution back to CommonShopProblem solution.

Parameters:
  • solution – RCPSP solution

  • source_problem – Original CommonShopProblem

Returns:

Equivalent CommonShopProblem solution

forward_transform_solution(solution: AnyShopSolution, target_problem: RcpspProblem) RcpspSolution | None[source]

Transform CommonShopProblem solution to RCPSP solution (for warm-start).

Parameters:
  • solution – CommonShopProblem solution

  • target_problem – Target RCPSP problem

Returns:

Equivalent RCPSP solution for warm-start

transform_problem(source_problem: CommonShopProblem) RcpspProblem[source]

Transform CommonShopProblem to multimode RCPSP.

Parameters:

source_problem – CommonShopProblem instance (JSP/FJSP/OSP)

Returns:

Equivalent multimode RCPSP problem

Module contents