discrete_optimization.fjsp package

Subpackages

Submodules

discrete_optimization.fjsp.parser module

discrete_optimization.fjsp.parser.get_data_available(data_folder: str | None = None, data_home: str | None = None) list[str][source]

Get datasets available for jobshop.

discrete_optimization.fjsp.parser.parse_file(file_path: str)[source]

discrete_optimization.fjsp.problem module

class discrete_optimization.fjsp.problem.FJobShopProblem(list_jobs: list[Job], n_jobs: int = None, n_machines: int = None, horizon: int = None)[source]

Bases: GenericSchedulingProblem[tuple[int, int], None, int, None], WithoutNonRenewableResourceProblem[tuple[int, int]], WithoutAllocationProblem[tuple[int, int]]

property cumulative_resources_list: list[int]
evaluate(variable: FJobShopSolution) 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_cumulative_resource_consumption(resource: int, task: tuple[int, int], mode: int) int[source]

Get cumulative resource consumption of the task in the given mode

Parameters:
  • resource – cumulative resource

  • task

  • mode – not used for single mode problems

Returns:

the consumption for cumulative resources.

get_last_tasks() list[tuple[int, int]][source]

Get a sublist of tasks that are candidate to be the last one scheduled.

Default to all tasks.

get_makespan_upper_bound() int[source]

Get an upper bound on global makespan.

get_objective_register() ObjectiveRegister[source]

Returns the objective definition.

Returns (ObjectiveRegister): object defining the objective criteria.

get_precedence_constraints() dict[tuple[int, int], list[tuple[int, int]]][source]

Map each task to the tasks that need to be performed after it.

get_resource_availabilities(resource: int) list[tuple[int, int, int]][source]

Get availabilities intervals for a given resource

List of availability intervals of a resource. If the resource is not available, potentially no interval returned.

It is assumed that the intervals are disjunct though.

Parameters:

resource

Returns:

list of intervals of the form (start, end, value), which means from time start to time end, there are value of the resource available. NB: the start is included, the end is excluded (start <= t < end)

get_solution_type() type[Solution][source]

Returns the class implementation of a Solution.

Returns (class): class object of the given Problem.

get_task_mode_duration(task: tuple[int, int], mode: int) int[source]

Get task duration according to mode.

Parameters:
  • task

  • mode – not used for single-mode problems

Returns:

get_task_modes(task: tuple[int, int]) set[int][source]

Retrieve mode found for given task.

Parameters:

task

Returns:

list_jobs: list[Job]
n_jobs: int
n_machines: int
satisfy(variable: FJobShopSolution) 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.

property tasks_list: list[tuple[int, int]]

List of all tasks to schedule or allocate to.

class discrete_optimization.fjsp.problem.FJobShopSolution(problem: FJobShopProblem, schedule: list[list[tuple[int, int, int, int]]])[source]

Bases: GenericSchedulingSolution[tuple[int, int], None, int, None], WithoutNonRenewableResourceSolution[tuple[int, int]], WithoutAllocationSolution[tuple[int, int]]

copy() FJobShopSolution[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.

get_end_time(task: tuple[int, int]) int[source]
get_machine(task: tuple[int, int]) int[source]
get_mode(task: tuple[int, int]) int[source]

Get ‘mode’ of given task, aka chosen machine.

get_start_time(task: tuple[int, int]) int[source]
problem: FJobShopProblem
class discrete_optimization.fjsp.problem.Job(job_id: 'int', sub_jobs: 'list[SubjobOptions]')[source]

Bases: object

job_id: int
sub_jobs: list[list[Subjob]]

Module contents