discrete_optimization.generic_tools.hub_solver.tempo package

Submodules

discrete_optimization.generic_tools.hub_solver.tempo.tempo_tools module

class discrete_optimization.generic_tools.hub_solver.tempo.tempo_tools.FormatEnum(value)[source]

Bases: Enum

An enumeration.

FJSP = 3
JSP = 2
PSPLIB = 1
WORKFORCE = 0
class discrete_optimization.generic_tools.hub_solver.tempo.tempo_tools.TempoLogsCallback[source]

Bases: Callback

get_df_metrics(phase: int = 0) DataFrame[source]

Construct a dataframe indexed by time of the recorded metrics (fitness, bounds…).

on_solve_end(res: ResultStorage, solver: TempoSchedulingSolver)[source]

Called at the end of solve.

Parameters:
  • res – current result storage

  • solver – solvers using the callback

class discrete_optimization.generic_tools.hub_solver.tempo.tempo_tools.TempoSchedulingSolver(problem: Problem, params_objective_function: ParamsObjectiveFunction | None = None, input_format: FormatEnum | None = None, path_to_tempo_executable: str | None = None, **kwargs: Any)[source]

Bases: SolverDO

get_input_format() str[source]
get_processed_logs()[source]
get_processed_status()[source]
get_tmp_folder_path() str[source]
hyperparameters: list[Hyperparameter] = [CategoricalHyperparameter(name='use_lns', default=False, depends_on=None, name_in_kwargs='use_lns'), IntegerHyperparameter(name='greedy_runs', default=1, depends_on=None, name_in_kwargs='greedy_runs', low=0, high=100, step=1, log=False)]

Hyperparameters available for this solver.

These hyperparameters are to be feed to **kwargs found in
  • __init__()

  • init_model() (when available)

  • solve()

abstract 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.

abstract retrieve_solution(path_to_output: str, process_stdout: str) Solution[source]
solve(callbacks: list[Callback] | None = None, time_limit: float = 10, **kwargs: Any) ResultStorage[source]

Generic solving function.

Parameters:
  • callbacks – list of callbacks used to hook into the various stage of the solve

  • **kwargs – any argument specific to the solver

Solvers deriving from SolverDo should use callbacks methods .on_step_end(), … during solve(). But some solvers are not yet updated and are just ignoring it.

Returns (ResultStorage): a result object containing potentially a pool of solutions to a discrete-optimization problem

discrete_optimization.generic_tools.hub_solver.tempo.tempo_tools.from_format_to_str_arg(format_enum: FormatEnum)[source]
discrete_optimization.generic_tools.hub_solver.tempo.tempo_tools.parse_solver_log_robust(file_content: str) tuple[list[DataFrame], list[str]][source]

Parses a solver log to analyze multiple, sequential optimization phases with robust transition logic.

Parameters:

file_content – A string containing the full content of the log file.

Returns:

  • A list of pandas DataFrames, one for each optimization phase.

  • A list of strings describing the end status of each phase.

Return type:

A tuple containing

Module contents