discrete_optimization.jsp package
Subpackages
Submodules
discrete_optimization.jsp.parser module
- discrete_optimization.jsp.parser.get_data_available(data_folder: str | None = None, data_home: str | None = None) list[str] [source]
Get datasets available for jobshop.
- Params:
- data_folder: folder where datasets for jobshop whould be find.
If None, we look in “jobshop” subdirectory of data_home.
- data_home: root directory for all datasets. Is None, set by
default to “~/discrete_optimization_data “
discrete_optimization.jsp.problem module
- class discrete_optimization.jsp.problem.JobShopProblem(list_jobs: list[list[Subjob]], n_jobs: int | None = None, n_machines: int | None = None, horizon: int | None = None)[source]
Bases:
Problem
- evaluate(variable: JobShopSolution) dict[str, float] [source]
Evaluate a given solution object for the given problem.
This method should return a dictionnary of KPI, that can be then used for mono or multiobjective optimization.
- Parameters:
variable (Solution) – the Solution object to evaluate.
Returns: dictionnary of float kpi for the solution.
- get_attribute_register() EncodingRegister [source]
Returns how the Solution should be encoded.
Returns (EncodingRegister): content of the encoding of the solution
- get_objective_register() ObjectiveRegister [source]
Returns the objective definition.
Returns (ObjectiveRegister): object defining the objective criteria.
- get_solution_type() type[Solution] [source]
Returns the class implementation of a Solution.
Returns (class): class object of the given Problem.
- n_jobs: int
- n_machines: int
- satisfy(variable: JobShopSolution) bool [source]
Computes if a solution satisfies or not the constraints of the problem.
- Parameters:
variable – the Solution object to check satisfability
Returns (bool): boolean true if the constraints are fulfilled, false elsewhere.
- class discrete_optimization.jsp.problem.JobShopSolution(problem: JobShopProblem, schedule: list[list[tuple[int, int]]])[source]
Bases:
Solution
- change_problem(new_problem: Problem) None [source]
If relevant to the optimisation problem, change the underlying problem instance for the solution.
This method can be used to evaluate a solution for different instance of problems.
- Parameters:
new_problem (Problem) – another problem instance from which the solution can be evaluated
Returns: None
- copy() Solution [source]
Deep copy of the solution.
The copy() function should return a new object containing the same input as the current object, that respects the following expected behaviour: -y = x.copy() -if do some inplace change of y, the changes are not done in x.
Returns: a new object from which you can manipulate attributes without changing the original object.
discrete_optimization.jsp.utils module
- discrete_optimization.jsp.utils.transform_jsp_to_rcpsp(jsp_problem: JobShopProblem) RcpspProblem [source]