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:
ProblemTransformation[CommonShopProblem,AnyShopSolution,GenericSchedulingImplProblem,GenericSchedulingImplSolution]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())
- back_transform_solution(solution: GenericSchedulingImplSolution, source_problem: CommonShopProblem) AnyShopSolution[source]
Transform GenericSchedulingImplSolution back to CommonShopProblem solution.
- Parameters:
solution – GenericSchedulingImplSolution
source_problem – Original CommonShopProblem
- Returns:
Equivalent CommonShopProblem solution
- forward_transform_solution(solution: AnyShopSolution, target_problem: GenericSchedulingImplProblem) GenericSchedulingImplSolution | None[source]
Transform CommonShopProblem solution to GenericSchedulingImplSolution.
- Parameters:
solution – CommonShopProblem solution
target_problem – Target GenericSchedulingImplProblem
- Returns:
Equivalent GenericSchedulingImplSolution for warm-start
- transform_problem(source_problem: CommonShopProblem) GenericSchedulingImplProblem[source]
Transform CommonShopProblem to GenericSchedulingImplProblem.
- Parameters:
source_problem – CommonShopProblem instance (JSP/FJSP/OSP)
- Returns:
Equivalent GenericSchedulingImplProblem
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