discrete_optimization.rcpsp_alternative package

Subpackages

Submodules

discrete_optimization.rcpsp_alternative.problem module

class discrete_optimization.rcpsp_alternative.problem.RcpspWithAlternativePath(resources: dict[str, int | list[int]], non_renewable_resources: list[str], mode_details: dict[Hashable, dict[int, dict[str, int]]], successors: dict[Hashable, list[Hashable]], horizon: int, tasks_list: list[Hashable] | None = None, source_task: Hashable | None = None, sink_task: Hashable | None = None, name_task: dict[Hashable, str] | None = None, calendar_details: dict[str, list[list[int]]] | None = None, special_constraints: SpecialConstraintsDescription | None = None, fixed_permutation: list[int] | None = None, fixed_modes: list[int] | None = None, alternative_tasks: list[Hashable] | None = None, list_alternative_subproblem: list[AlternativeSchedulingSubProblem] = None, **kwargs: Any)[source]

Bases: RcpspProblem

get_alternative_scheduling_subproblem() → list[AlternativeSchedulingSubProblem][source]
get_cumulative_resource_consumption(resource: str, task: Hashable, 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_non_renewable_resource_consumption(resource: str, task: Hashable, mode: int) → int[source]

Get resource consumption of the task in the given mode

Parameters:
  • resource – non-renewable resource

  • task

  • mode – not used for single mode problems

Returns:.

Raises:

ValueError – if resource consumption is depending on other variables than mode

get_task_mode_duration(task: Hashable, mode: int) → int[source]

Get task duration according to mode.

Parameters:
  • task

  • mode – not used for single-mode problems

Returns:

get_task_modes(task: Hashable) → set[int][source]

Retrieve mode found for given task.

Parameters:

task

Returns:

is_optional(task: Hashable) → bool[source]

Whether a task is optional or not.

It means that the task can be ignored in the solution. If absent of the solution, it can also be removed from the constraints.

Default to no optional task.

discrete_optimization.rcpsp_alternative.problem.get_optional_tasks_done(sol: RcpspSolution, problem: RcpspWithAlternativePath)[source]

discrete_optimization.rcpsp_alternative.utils module

discrete_optimization.rcpsp_alternative.utils.create_problem_rcpsp(problem: RcpspProblem, nb_alternative_paths: int = 3, range_nb_subpath: tuple = (1, 4), range_len_subpath: tuple = (1, 5), factor_makespan: float = 3.0) → RcpspWithAlternativePath[source]

Module contents