discrete_optimization.jsp.solvers package
Submodules
discrete_optimization.jsp.solvers.cpsat module
- class discrete_optimization.jsp.solvers.cpsat.CpSatJspSolver(problem: JobShopProblem, **kwargs: Any)[source]
Bases:
SchedulingCpSatSolver[tuple[int,int]],WarmstartMixin- get_task_start_or_end_variable(task: tuple[int, int], start_or_end: StartOrEnd) LinearExpr | IntVar | int | int8 | uint8 | int32 | uint32 | int64 | uint64[source]
Retrieve the variable storing the start or end time of given task.
- Parameters:
task
start_or_end
Returns:
- problem: JobShopProblem
- retrieve_solution(cpsolvercb: CpSolverSolutionCallback) JobShopSolution[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: JobShopSolution) None[source]
Make the solver warm start from the given solution.
discrete_optimization.jsp.solvers.dp module
- class discrete_optimization.jsp.solvers.dp.DpJspSolver(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')]
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: JobShopProblem
- set_warm_start(solution: JobShopSolution) None[source]
Make the solver warm start from the given solution.
discrete_optimization.jsp.solvers.optal module
- class discrete_optimization.jsp.solvers.optal.OptalJspSolver(problem: JobShopProblem, params_objective_function: ParamsObjectiveFunction | None = None, **kwargs: Any)[source]
Bases:
OptalSolver- build_command(parameters_cp: ParametersCp | None = None, time_limit: int = 10, **args: Any)[source]
Build the command line call for optal cp. You can pass parameters from the Parameters class of optal cp for example : searchType=fds, worker0-1.noOverlapPropagationLevel=4 if you want worker 0 and 1 to use this parameters etc. TODO : list such parameters in hyperparameter of this wrapped solver.
- init_model(**args: Any) None[source]
Instantiate a CP model instance
Afterwards, self.instance should not be None anymore.
- problem: JobShopProblem
- discrete_optimization.jsp.solvers.optal.from_jsp_to_jsplib(problem: JobShopProblem) str[source]
discrete_optimization.jsp.solvers.tempo module
- class discrete_optimization.jsp.solvers.tempo.TempoJspScheduler(problem: Problem, params_objective_function: ParamsObjectiveFunction | None = None, input_format: FormatEnum | None = None, path_to_tempo_executable: str | None = None, **kwargs: Any)[source]
Bases:
TempoSchedulingSolver- init_model(**kwargs: Any) None[source]
For tempo solver, this should transform the python object into some format that tempo can understand. For now it’s via the creation of a temporary _file_input.
- problem: JobShopProblem
- retrieve_solution(path_to_output: str, process_stdout: str) JobShopSolution[source]
- discrete_optimization.jsp.solvers.tempo.from_jsp_to_jsplib(problem: JobShopProblem) str[source]
- discrete_optimization.jsp.solvers.tempo.parse_output(solver_output: str, problem: JobShopProblem) JobShopSolution[source]