discrete_optimization.rcpsp package
Subpackages
- discrete_optimization.rcpsp.solvers package
- Submodules
- discrete_optimization.rcpsp.solvers.cp_mzn module
CPMultimodeWithFakeTaskRcpspSolver()
CpModesMultimodeRcpspSolver
CpMultimodePreemptiveRcpspSolver
CpMultimodePreemptiveRcpspSolver.add_hard_special_constraints()
CpMultimodePreemptiveRcpspSolver.constraint_duration_string_preemptive_i()
CpMultimodePreemptiveRcpspSolver.constraint_duration_to_min_duration_preemptive()
CpMultimodePreemptiveRcpspSolver.constraint_end_time_string()
CpMultimodePreemptiveRcpspSolver.constraint_minduration_all_tasks()
CpMultimodePreemptiveRcpspSolver.constraint_objective_equal_makespan()
CpMultimodePreemptiveRcpspSolver.constraint_objective_makespan()
CpMultimodePreemptiveRcpspSolver.constraint_objective_max_time_set_of_jobs()
CpMultimodePreemptiveRcpspSolver.constraint_ressource_requirement_at_time_t()
CpMultimodePreemptiveRcpspSolver.constraint_start_time_precomputed()
CpMultimodePreemptiveRcpspSolver.constraint_start_time_string()
CpMultimodePreemptiveRcpspSolver.constraint_start_time_string_preemptive_i()
CpMultimodePreemptiveRcpspSolver.constraint_sum_of_ending_time()
CpMultimodePreemptiveRcpspSolver.constraint_sum_of_starting_time()
CpMultimodePreemptiveRcpspSolver.constraint_task_to_mode()
CpMultimodePreemptiveRcpspSolver.init_model()
CpMultimodePreemptiveRcpspSolver.problem
CpMultimodePreemptiveRcpspSolver.retrieve_solution()
CpMultimodeRcpspSolver
CpMultimodeRcpspSolver.add_hard_special_constraints()
CpMultimodeRcpspSolver.constraint_end_time_string()
CpMultimodeRcpspSolver.constraint_objective_equal_makespan()
CpMultimodeRcpspSolver.constraint_objective_makespan()
CpMultimodeRcpspSolver.constraint_objective_max_time_set_of_jobs()
CpMultimodeRcpspSolver.constraint_start_time_string()
CpMultimodeRcpspSolver.constraint_sum_of_ending_time()
CpMultimodeRcpspSolver.constraint_sum_of_starting_time()
CpMultimodeRcpspSolver.constraint_task_to_mode()
CpMultimodeRcpspSolver.hyperparameters
CpMultimodeRcpspSolver.init_model()
CpMultimodeRcpspSolver.problem
CpMultimodeRcpspSolver.retrieve_solution()
CpNoBoolMultimodeRcpspSolver
CpNoBoolMultimodeRcpspSolver.constraint_end_time_string()
CpNoBoolMultimodeRcpspSolver.constraint_objective_equal_makespan()
CpNoBoolMultimodeRcpspSolver.constraint_objective_makespan()
CpNoBoolMultimodeRcpspSolver.constraint_objective_max_time_set_of_jobs()
CpNoBoolMultimodeRcpspSolver.constraint_start_time_string()
CpNoBoolMultimodeRcpspSolver.init_model()
CpNoBoolMultimodeRcpspSolver.problem
CpNoBoolMultimodeRcpspSolver.retrieve_solution()
CpPreemptiveRcpspSolver
CpRcpspSolver
CpRcpspSolver.add_hard_special_constraints()
CpRcpspSolver.constraint_end_time_string()
CpRcpspSolver.constraint_objective_equal_makespan()
CpRcpspSolver.constraint_objective_makespan()
CpRcpspSolver.constraint_objective_max_time_set_of_jobs()
CpRcpspSolver.constraint_start_time_string()
CpRcpspSolver.constraint_sum_of_ending_time()
CpRcpspSolver.constraint_sum_of_starting_time()
CpRcpspSolver.get_stats()
CpRcpspSolver.hyperparameters
CpRcpspSolver.init_model()
CpRcpspSolver.problem
CpRcpspSolver.retrieve_solution()
add_constraints_string()
add_fake_task_cp_data()
add_hard_special_constraints()
add_hard_special_constraints_mrcpsp()
add_soft_special_constraints()
add_soft_special_constraints_mrcpsp()
define_second_part_objective()
hard_end_window()
hard_start_after_nunit()
hard_start_after_nunit_mrcpsp()
hard_start_at_end()
hard_start_at_end_mrcpsp()
hard_start_at_end_plus_offset()
hard_start_at_end_plus_offset_mrcpsp()
hard_start_times()
hard_start_times_mrcpsp()
hard_start_together()
hard_start_together_mrcpsp()
hard_start_window()
precompute_possible_starting_time_interval()
soft_end_window()
soft_end_window_mrcpsp()
soft_start_after_nunit()
soft_start_after_nunit_mrcpsp()
soft_start_at_end()
soft_start_at_end_mrcpsp()
soft_start_at_end_plus_offset()
soft_start_at_end_plus_offset_mrcpsp()
soft_start_times()
soft_start_times_mrcpsp()
soft_start_together()
soft_start_together_mrcpsp()
soft_start_window()
soft_start_window_mrcpsp()
- discrete_optimization.rcpsp.solvers.cp_mzn_models module
CpModelEnum
CpModelEnum.MODES
CpModelEnum.MULTI
CpModelEnum.MULTI_CALENDAR
CpModelEnum.MULTI_CALENDAR_BOXES
CpModelEnum.MULTI_FAKETASKS
CpModelEnum.MULTI_NO_BOOL
CpModelEnum.MULTI_PREEMPTIVE
CpModelEnum.MULTI_PREEMPTIVE_CALENDAR
CpModelEnum.MULTI_RESOURCE_FEASIBILITY
CpModelEnum.SINGLE
CpModelEnum.SINGLE_PREEMPTIVE
CpModelEnum.SINGLE_PREEMPTIVE_CALENDAR
- discrete_optimization.rcpsp.solvers.cp_mzn_multiscenario module
- discrete_optimization.rcpsp.solvers.cpm module
- discrete_optimization.rcpsp.solvers.cpsat module
CpSatCumulativeResourceRcpspSolver
CpSatCumulativeResourceRcpspSolver.add_lexico_constraint()
CpSatCumulativeResourceRcpspSolver.create_cumulative_constraint_and_resource_capa()
CpSatCumulativeResourceRcpspSolver.create_resource_capacity_var()
CpSatCumulativeResourceRcpspSolver.get_lexico_objective_value()
CpSatCumulativeResourceRcpspSolver.get_lexico_objectives_available()
CpSatCumulativeResourceRcpspSolver.hyperparameters
CpSatCumulativeResourceRcpspSolver.implements_lexico_api()
CpSatCumulativeResourceRcpspSolver.init_model()
CpSatCumulativeResourceRcpspSolver.retrieve_solution()
CpSatCumulativeResourceRcpspSolver.set_lexico_objective()
CpSatRcpspSolver
CpSatRcpspSolver.add_classical_precedence_constraints()
CpSatRcpspSolver.add_one_mode_selected_per_task()
CpSatRcpspSolver.create_cumulative_constraint()
CpSatRcpspSolver.create_fake_tasks()
CpSatRcpspSolver.create_mode_pair_constraint()
CpSatRcpspSolver.init_model()
CpSatRcpspSolver.init_temporal_variable()
CpSatRcpspSolver.retrieve_solution()
CpSatRcpspSolver.set_warm_start()
CpSatResourceRcpspSolver
CpSatResourceRcpspSolver.add_lexico_constraint()
CpSatResourceRcpspSolver.create_cumulative_constraint_and_used_resource()
CpSatResourceRcpspSolver.get_lexico_objective_value()
CpSatResourceRcpspSolver.get_lexico_objectives_available()
CpSatResourceRcpspSolver.implements_lexico_api()
CpSatResourceRcpspSolver.init_model()
CpSatResourceRcpspSolver.retrieve_solution()
CpSatResourceRcpspSolver.set_lexico_objective()
- discrete_optimization.rcpsp.solvers.dp module
DpRcpspModeling
DpRcpspSolver
DpRcpspSolver.hyperparameters
DpRcpspSolver.init_model()
DpRcpspSolver.init_model_multimode()
DpRcpspSolver.init_model_multimode_calendar()
DpRcpspSolver.init_model_task()
DpRcpspSolver.init_model_task_time()
DpRcpspSolver.init_model_task_time_calendar()
DpRcpspSolver.init_model_task_upd()
DpRcpspSolver.modeling
DpRcpspSolver.problem
DpRcpspSolver.retrieve_solution()
DpRcpspSolver.retrieve_solution_multimode()
DpRcpspSolver.retrieve_solution_task()
DpRcpspSolver.retrieve_solution_task_time()
DpRcpspSolver.set_warm_start()
DpRcpspSolver.transitions
create_resource_consumption_from_calendar()
- discrete_optimization.rcpsp.solvers.ga module
- discrete_optimization.rcpsp.solvers.lns_cp module
- discrete_optimization.rcpsp.solvers.lns_cp_preemptive module
- discrete_optimization.rcpsp.solvers.lns_lp module
- discrete_optimization.rcpsp.solvers.lp module
- discrete_optimization.rcpsp.solvers.lp_gantt module
- discrete_optimization.rcpsp.solvers.pile module
- discrete_optimization.rcpsp.solvers.rcpsp_solver module
- Module contents
Submodules
discrete_optimization.rcpsp.fast_function module
- discrete_optimization.rcpsp.fast_function.compute_mean_ressource(modes_array: ndarray[Any, dtype[int64]], consumption_array: ndarray[Any, dtype[int64]], start_array: ndarray[Any, dtype[int64]], end_array: ndarray[Any, dtype[int64]], horizon: int, ressource_available: ndarray[Any, dtype[int64]], ressource_renewable: ndarray[Any, dtype[bool]]) float [source]
- discrete_optimization.rcpsp.fast_function.compute_ressource_consumption(modes_array: ndarray[Any, dtype[int64]], consumption_array: ndarray[Any, dtype[int64]], start_array: ndarray[Any, dtype[int64]], end_array: ndarray[Any, dtype[int64]], horizon: int, ressource_available: ndarray[Any, dtype[int64]], ressource_renewable: ndarray[Any, dtype[bool]]) dict[int, ndarray[Any, dtype[int64]]] [source]
- discrete_optimization.rcpsp.fast_function.sgs_fast(permutation_task: ndarray[Any, dtype[int64]], modes_array: ndarray[Any, dtype[int64]], consumption_array: ndarray[Any, dtype[int64]], duration_array: ndarray[Any, dtype[int64]], predecessors: ndarray[Any, dtype[int64]], successors: ndarray[Any, dtype[int64]], horizon: int, ressource_available: ndarray[Any, dtype[int64]], ressource_renewable: ndarray[Any, dtype[bool]], minimum_starting_time_array: ndarray[Any, dtype[int64]]) tuple[dict[int, tuple[int, int]], bool] [source]
- discrete_optimization.rcpsp.fast_function.sgs_fast_partial_schedule(current_time: int, permutation_task: ndarray[Any, dtype[int64]], modes_array: ndarray[Any, dtype[int64]], completed_task_indicator: ndarray[Any, dtype[int64]], completed_task_times: ndarray[Any, dtype[int64]], scheduled_task: ndarray[Any, dtype[int64]], consumption_array: ndarray[Any, dtype[int64]], duration_array: ndarray[Any, dtype[int64]], predecessors: ndarray[Any, dtype[int64]], successors: ndarray[Any, dtype[int64]], horizon: int, ressource_available: ndarray[Any, dtype[int64]], ressource_renewable: ndarray[Any, dtype[bool]], minimum_starting_time_array: ndarray[Any, dtype[int64]]) tuple[dict[int, tuple[int, int]], bool] [source]
- discrete_optimization.rcpsp.fast_function.sgs_fast_partial_schedule_incomplete_permutation_tasks(current_time: int, permutation_task: ndarray[Any, dtype[int64]], modes_array: ndarray[Any, dtype[int64]], completed_task_indicator: ndarray[Any, dtype[int64]], completed_task_times: ndarray[Any, dtype[int64]], scheduled_task: ndarray[Any, dtype[int64]], consumption_array: ndarray[Any, dtype[int64]], duration_array: ndarray[Any, dtype[int64]], predecessors: ndarray[Any, dtype[int64]], successors: ndarray[Any, dtype[int64]], horizon: int, ressource_available: ndarray[Any, dtype[int64]], ressource_renewable: ndarray[Any, dtype[bool]], minimum_starting_time_array: ndarray[Any, dtype[int64]]) tuple[dict[int, tuple[int, int]], bool] [source]
- discrete_optimization.rcpsp.fast_function.sgs_fast_partial_schedule_preemptive(current_time: int, permutation_task: ndarray[Any, dtype[int64]], modes_array: ndarray[Any, dtype[int64]], completed_task_indicator: ndarray[Any, dtype[int64]], partial_schedule_starts: ndarray[Any, dtype[int64]], partial_schedule_ends: ndarray[Any, dtype[int64]], preemptive_tag: ndarray[Any, dtype[bool]], consumption_array: ndarray[Any, dtype[int64]], duration_array: ndarray[Any, dtype[int64]], predecessors: ndarray[Any, dtype[int64]], successors: ndarray[Any, dtype[int64]], horizon: int, ressource_available: ndarray[Any, dtype[int64]], ressource_renewable: ndarray[Any, dtype[bool]], minimum_starting_time_array: ndarray[Any, dtype[int64]]) tuple[dict[int, ndarray[Any, dtype[int64]]], dict[int, ndarray[Any, dtype[int64]]], bool] [source]
- discrete_optimization.rcpsp.fast_function.sgs_fast_partial_schedule_preemptive_minduration(current_time: int, permutation_task: ndarray[Any, dtype[int64]], modes_array: ndarray[Any, dtype[int64]], completed_task_indicator: ndarray[Any, dtype[int64]], partial_schedule_starts: ndarray[Any, dtype[int64]], partial_schedule_ends: ndarray[Any, dtype[int64]], preemptive_tag: ndarray[Any, dtype[bool]], consumption_array: ndarray[Any, dtype[int64]], duration_array: ndarray[Any, dtype[int64]], predecessors: ndarray[Any, dtype[int64]], successors: ndarray[Any, dtype[int64]], horizon: int, ressource_available: ndarray[Any, dtype[int64]], ressource_renewable: ndarray[Any, dtype[bool]], min_duration_preemptive_bool: ndarray[Any, dtype[bool]], min_duration_preemptive: ndarray[Any, dtype[int64]]) tuple[dict[int, ndarray[Any, dtype[int64]]], dict[int, ndarray[Any, dtype[int64]]], bool] [source]
- discrete_optimization.rcpsp.fast_function.sgs_fast_preemptive(permutation_task: ndarray[Any, dtype[int64]], modes_array: ndarray[Any, dtype[int64]], consumption_array: ndarray[Any, dtype[int64]], duration_array: ndarray[Any, dtype[int64]], preemptive_tag: ndarray[Any, dtype[bool]], predecessors: ndarray[Any, dtype[int64]], successors: ndarray[Any, dtype[int64]], horizon: int, ressource_available: ndarray[Any, dtype[int64]], ressource_renewable: ndarray[Any, dtype[bool]], minimum_starting_time_array: ndarray[Any, dtype[int64]]) tuple[dict[int, ndarray[Any, dtype[int64]]], dict[int, ndarray[Any, dtype[int64]]], bool] [source]
- discrete_optimization.rcpsp.fast_function.sgs_fast_preemptive_minduration(permutation_task: ndarray[Any, dtype[int64]], modes_array: ndarray[Any, dtype[int64]], consumption_array: ndarray[Any, dtype[int64]], duration_array: ndarray[Any, dtype[int64]], preemptive_tag: ndarray[Any, dtype[bool]], predecessors: ndarray[Any, dtype[int64]], successors: ndarray[Any, dtype[int64]], horizon: int, ressource_available: ndarray[Any, dtype[int64]], ressource_renewable: ndarray[Any, dtype[bool]], min_duration_preemptive_bool: ndarray[Any, dtype[bool]], min_duration_preemptive: ndarray[Any, dtype[int64]]) tuple[dict[int, ndarray[Any, dtype[int64]]], dict[int, ndarray[Any, dtype[int64]]], bool] [source]
- discrete_optimization.rcpsp.fast_function.sgs_fast_preemptive_some_special_constraints(permutation_task: ndarray[Any, dtype[int64]], modes_array: ndarray[Any, dtype[int64]], consumption_array: ndarray[Any, dtype[int64]], duration_array: ndarray[Any, dtype[int64]], preemptive_tag: ndarray[Any, dtype[bool]], predecessors: ndarray[Any, dtype[int64]], successors: ndarray[Any, dtype[int64]], start_at_end_plus_offset: ndarray[Any, dtype[int64]], start_after_nunit: ndarray[Any, dtype[int64]], minimum_starting_time_array: ndarray[Any, dtype[int64]], horizon: int, ressource_available: ndarray[Any, dtype[int64]], ressource_renewable: ndarray[Any, dtype[bool]]) tuple[dict[int, ndarray[Any, dtype[int64]]], dict[int, ndarray[Any, dtype[int64]]], bool] [source]
discrete_optimization.rcpsp.mutation module
- class discrete_optimization.rcpsp.mutation.DeadlineMutationRcpsp(problem: RcpspProblem | PreemptiveRcpspProblem | SpecialConstraintsPreemptiveRcpspProblem | MultiskillRcpspProblem | VariantMultiskillRcpspProblem, solution: PreemptiveRcpspSolution | RcpspSolution | MultiskillRcpspSolution | VariantMultiskillRcpspSolution | PreemptiveMultiskillRcpspSolution | VariantPreemptiveMultiskillRcpspSolution, attribute: str | None = None, nb_swap: int = 1)[source]
Bases:
Mutation
- static build(problem: Problem, solution: Solution, **kwargs: Any) DeadlineMutationRcpsp [source]
- mutate(solution: PreemptiveRcpspSolution | RcpspSolution | MultiskillRcpspSolution | VariantMultiskillRcpspSolution | PreemptiveMultiskillRcpspSolution | VariantPreemptiveMultiskillRcpspSolution) tuple[PreemptiveRcpspSolution | RcpspSolution | MultiskillRcpspSolution | VariantMultiskillRcpspSolution | PreemptiveMultiskillRcpspSolution | VariantPreemptiveMultiskillRcpspSolution, LocalMove] [source]
- class discrete_optimization.rcpsp.mutation.PermutationMutationRcpsp(problem: Problem, solution: Solution, other_mutation: Mutation)[source]
Bases:
Mutation
- static build(problem: ~discrete_optimization.generic_tools.do_problem.Problem, solution: ~discrete_optimization.generic_tools.do_problem.Solution, other_mutation: type[~discrete_optimization.generic_tools.do_mutation.Mutation] = <class 'discrete_optimization.generic_tools.mutations.permutation_mutations.PermutationShuffleMutation'>, **kwargs: ~typing.Any) PermutationMutationRcpsp [source]
- mutate(solution: RcpspSolution) tuple[Solution, LocalMove] [source]
- mutate_and_compute_obj(solution: RcpspSolution) tuple[Solution, LocalMove, dict[str, float]] [source]
discrete_optimization.rcpsp.parser module
- discrete_optimization.rcpsp.parser.get_data_available(data_folder: str | None = None, data_home: str | None = None) list[str] [source]
Get datasets available for rcpsp.
- Params:
- data_folder: folder where datasets for rcpsp whould be find.
If None, we look in “rcpsp” subdirectory of data_home.
- data_home: root directory for all datasets. Is None, set by
default to “~/discrete_optimization_data “
- discrete_optimization.rcpsp.parser.parse_file(file_path: str) RcpspProblem [source]
- discrete_optimization.rcpsp.parser.parse_patterson(input_data: str) RcpspProblem [source]
- discrete_optimization.rcpsp.parser.parse_psplib(input_data: str) RcpspProblem [source]
discrete_optimization.rcpsp.problem module
- class discrete_optimization.rcpsp.problem.RcpspProblem(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, horizon_multiplier: int = 1, 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, relax_the_start_at_end: bool = True, fixed_permutation: list[int] | None = None, fixed_modes: list[int] | None = None, **kwargs: Any)[source]
Bases:
Problem
- resources
- non_renewable_resources
- mode_details
- successors
- horizon
- horizon_multiplier
- tasks_list
- source_task
- sink_task
- name_task
- n_jobs
- Type:
int
- n_jobs_non_dummy
excluding dummy activities Start (0) and End (n)
- Type:
int
- special_constraints
- do_special_constraints
- Type:
bool
- relax_the_start_at_end
relax some conditions only if do_special_constraints
- Type:
bool
- fixed_permutation
- Type:
Optional[list[int]]
- fixed_modes
- Type:
Optional[list[int]]
- Parameters:
resources – {resource_name: number_of_resource}
non_renewable_resources – [resource_name3, resource_name4]
mode_details – {job_id: {mode_id: {resource_name1: number_of_resources_needed, resource_name2: …}} one key being “duration”
successors
horizon
horizon_multiplier
tasks_list – {task_id: list of successor task ids}
source_task
sink_task
name_task
special_constraints
relax_the_start_at_end
fixed_permutation
fixed_modes
**kwargs
- compute_resource_consumption(rcpsp_sol: RcpspSolution) ndarray[Any, dtype[int64]] [source]
- copy() RcpspProblem [source]
- evaluate(rcpsp_sol: RcpspSolution) 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.
- evaluate_function(rcpsp_sol: RcpspSolution) tuple[int, float, int] [source]
- evaluate_mobj(rcpsp_sol: RcpspSolution) TupleFitness [source]
Default implementation of multiobjective evaluation.
It consists in flattening the evaluate() function and put in an array. User should probably custom this to be more efficient.
- Parameters:
variable (Solution) – the Solution object to evaluate.
Returns (TupleFitness): a flattened tuple fitness object representing the multi-objective criteria.
- evaluate_mobj_from_dict(dict_values: dict[str, float]) TupleFitness [source]
Return an multiobjective fitness from a dictionnary of kpi (output of evaluate function).
It consists in flattening the evaluate() function and put in an array. User should probably custom this to be more efficient.
- Parameters:
dict_values – output of evaluate() function
Returns (TupleFitness): a flattened tuple fitness object representing the multi-objective criteria.
- get_attribute_register() EncodingRegister [source]
Returns how the Solution should be encoded.
Returns (EncodingRegister): content of the encoding of the solution
- get_dummy_solution() RcpspSolution [source]
- 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.
- plot_ressource_view(rcpsp_sol: RcpspSolution) None [source]
- satisfy(rcpsp_sol: RcpspSolution) 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.
- set_fixed_attributes(encoding_str: str, sol: RcpspSolution) None [source]
- class discrete_optimization.rcpsp.problem.ScheduleGenerationScheme(value)[source]
Bases:
Enum
An enumeration.
- PARALLEL_SGS = 1
- SERIAL_SGS = 0
- discrete_optimization.rcpsp.problem.check_pair_mode_constraint(solution: RcpspSolution, pair_mode_constraint: PairModeConstraint)[source]
- discrete_optimization.rcpsp.problem.check_solution_with_special_constraints(problem: RcpspProblem, solution: RcpspSolution, relax_the_start_at_end: bool = True) bool [source]
- discrete_optimization.rcpsp.problem.compute_constraints_details(solution: RcpspSolution, constraints: SpecialConstraintsDescription) list[tuple[str, Hashable, Hashable, int | None, int | None, int]] [source]
- discrete_optimization.rcpsp.problem.compute_details_mode_constraint(solution: RcpspSolution, pair_mode_constraint: PairModeConstraint)[source]
- discrete_optimization.rcpsp.problem.create_np_data_and_jit_functions(rcpsp_problem: RcpspProblem) tuple[Callable[[...], tuple[dict[int, tuple[int, int]], bool]], Callable[[...], tuple[dict[int, tuple[int, int]], bool]], Callable[[...], float]] [source]
- discrete_optimization.rcpsp.problem.evaluate_constraints(solution: RcpspSolution, constraints: SpecialConstraintsDescription) int [source]
discrete_optimization.rcpsp.problem_preemptive module
- class discrete_optimization.rcpsp.problem_preemptive.PartialPreemptiveRcpspSolution(task_mode: dict[int, int] | None = None, start_times: dict[int, int] | None = None, end_times: dict[int, int] | None = None, partial_permutation: list[int] | None = None, list_partial_order: list[list[int]] | None = None, start_together: list[tuple[int, int]] | None = None, start_at_end: list[tuple[int, int]] | None = None, start_at_end_plus_offset: list[tuple[int, int, int]] | None = None, start_after_nunit: list[tuple[int, int, int]] | None = None, disjunctive_tasks: list[tuple[int, int]] | None = None, start_times_window: dict[Hashable, tuple[int, int]] | None = None, end_times_window: dict[Hashable, tuple[int, int]] | None = None)[source]
Bases:
object
- class discrete_optimization.rcpsp.problem_preemptive.PreemptiveRcpspProblem(resources: dict[str, int] | dict[str, list[int]], non_renewable_resources: list[str], mode_details: dict[Hashable, dict[str | int, dict[str, int]]], successors: dict[int | str, list[str | int]], horizon, horizon_multiplier=1, tasks_list: list[int | str] | None = None, source_task=None, sink_task=None, preemptive_indicator: dict[Hashable, bool] | None = None, duration_subtask: dict[Hashable, tuple[bool, int]] | None = None, name_task: dict[int, str] | None = None)[source]
Bases:
Problem
- compute_resource_consumption(rcpsp_sol: PreemptiveRcpspSolution)[source]
- evaluate(rcpsp_sol: PreemptiveRcpspSolution) 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.
- evaluate_function(rcpsp_sol: PreemptiveRcpspSolution)[source]
- evaluate_mobj(rcpsp_sol: PreemptiveRcpspSolution)[source]
Default implementation of multiobjective evaluation.
It consists in flattening the evaluate() function and put in an array. User should probably custom this to be more efficient.
- Parameters:
variable (Solution) – the Solution object to evaluate.
Returns (TupleFitness): a flattened tuple fitness object representing the multi-objective criteria.
- evaluate_mobj_from_dict(dict_values: dict[str, float]) TupleFitness [source]
Return an multiobjective fitness from a dictionnary of kpi (output of evaluate function).
It consists in flattening the evaluate() function and put in an array. User should probably custom this to be more efficient.
- Parameters:
dict_values – output of evaluate() function
Returns (TupleFitness): a flattened tuple fitness object representing the multi-objective criteria.
- get_attribute_register() EncodingRegister [source]
Returns how the Solution should be encoded.
Returns (EncodingRegister): content of the encoding of the solution
- get_modes_dict(rcpsp_solution: PreemptiveRcpspSolution)[source]
- 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.
- mode_details: dict[Hashable, dict[int, dict[str, int]]]
- n_jobs: int
- non_renewable_resources: list[str]
- plot_ressource_view(rcpsp_sol: PreemptiveRcpspSolution)[source]
- resources: dict[str, int] | dict[str, list[int]]
- satisfy(rcpsp_sol: PreemptiveRcpspSolution) 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.
- successors: dict[int, list[int]]
- class discrete_optimization.rcpsp.problem_preemptive.PreemptiveRcpspSolution(problem, rcpsp_permutation=None, rcpsp_schedule=None, rcpsp_modes=None, rcpsp_schedule_feasible=None, standardised_permutation=None)[source]
Bases:
Solution
- change_problem(new_problem: Problem)[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()[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.
- generate_schedule_from_permutation_serial_sgs_2(current_t=0, completed_tasks: set[Hashable] | None = None, partial_schedule: dict[Hashable, dict[str, list[int]]] | None = None, do_fast=True)[source]
- lazy_copy()[source]
This function should return a new object but possibly with mutable attributes from the original objects.
A typical use of lazy copy is in evolutionary algorithms or genetic algorithm where the use of local move don’t need to do a possibly costly deepcopy.
Returns (Solution): copy (possibly shallow) of the Solution
- rcpsp_modes: list[int]
- rcpsp_permutation: list[int] | array
- rcpsp_schedule: dict[Hashable, dict[str, list[int]]]
- standardised_permutation: list[int] | array
- class discrete_optimization.rcpsp.problem_preemptive.ScheduleGenerationScheme(value)[source]
Bases:
Enum
An enumeration.
- PARALLEL_SGS = 1
- SERIAL_SGS = 0
- discrete_optimization.rcpsp.problem_preemptive.compute_mean_resource_reserve(solution: PreemptiveRcpspSolution, rcpsp_problem: PreemptiveRcpspProblem)[source]
- discrete_optimization.rcpsp.problem_preemptive.compute_resource(solution: PreemptiveRcpspSolution, rcpsp_problem: PreemptiveRcpspProblem)[source]
- discrete_optimization.rcpsp.problem_preemptive.create_np_data_and_jit_functions(rcpsp_problem: PreemptiveRcpspProblem)[source]
- discrete_optimization.rcpsp.problem_preemptive.generate_schedule_from_permutation_serial_sgs(solution: PreemptiveRcpspSolution, rcpsp_problem: PreemptiveRcpspProblem)[source]
- discrete_optimization.rcpsp.problem_preemptive.generate_schedule_from_permutation_serial_sgs_partial_schedule(solution: PreemptiveRcpspSolution, rcpsp_problem: PreemptiveRcpspProblem, partial_schedule: dict[Hashable, dict[str, list[int]]], current_t: int, completed_tasks: set[Hashable]) tuple[dict[int, dict[str, list[int]]], bool] [source]
- discrete_optimization.rcpsp.problem_preemptive.get_rcpsp_problemp_preemptive(rcpsp_problem)[source]
- discrete_optimization.rcpsp.problem_preemptive.permutation_do_to_permutation_sgs_fast(rcpsp_problem: PreemptiveRcpspProblem, permutation_do: Iterable[int]) ndarray[Any, dtype[int64]] [source]
discrete_optimization.rcpsp.problem_robust module
- class discrete_optimization.rcpsp.problem_robust.AggregRcpspProblem(list_problem: Sequence[RcpspProblem], method_aggregating: MethodAggregating)[source]
Bases:
RobustProblem
,RcpspProblem
- evaluate(variable: RcpspSolution) dict[str, float] [source]
Aggregated evaluate function.
- Parameters:
variable (Solution) – Solution to evaluate on the different scenarios.
Returns (dict[str,float]): aggregated kpi on different scenarios.
- get_dummy_solution() RcpspSolution [source]
- get_unique_rcpsp_problem() RcpspProblem [source]
- list_problem: Sequence[RcpspProblem]
- class discrete_optimization.rcpsp.problem_robust.MethodBaseRobustification(value)[source]
Bases:
Enum
An enumeration.
- AVERAGE = 0
- BEST_CASE = 2
- PERCENTILE = 3
- SAMPLE = 4
- WORST_CASE = 1
- class discrete_optimization.rcpsp.problem_robust.MethodRobustification(method_base: MethodBaseRobustification, percentile: float = 50)[source]
Bases:
object
- method_base: MethodBaseRobustification
- percentile: float
- class discrete_optimization.rcpsp.problem_robust.UncertainRcpspProblem(base_rcpsp_problem: RcpspProblem, poisson_laws: dict[Hashable, dict[int, dict[str, tuple[int, int, int]]]], uniform_law: bool = True)[source]
Bases:
object
- create_rcpsp_problem(method_robustification: MethodRobustification) RcpspProblem [source]
- discrete_optimization.rcpsp.problem_robust.create_poisson_laws(base_rcpsp_problem: RcpspProblem, range_around_mean_resource: int = 1, range_around_mean_duration: int = 3, do_uncertain_resource: bool = True, do_uncertain_duration: bool = True) dict[Hashable, dict[int, dict[str, tuple[int, int, int]]]] [source]
- discrete_optimization.rcpsp.problem_robust.create_poisson_laws_duration(rcpsp_problem: RcpspProblem, range_around_mean: int = 3) dict[Hashable, dict[int, dict[str, tuple[int, int, int]]]] [source]
- discrete_optimization.rcpsp.problem_robust.create_poisson_laws_resource(rcpsp_problem: RcpspProblem, range_around_mean: int = 1) dict[Hashable, dict[int, dict[str, tuple[int, int, int]]]] [source]
discrete_optimization.rcpsp.problem_specialized_constraints module
- class discrete_optimization.rcpsp.problem_specialized_constraints.SpecialConstraintsPreemptiveRcpspProblem(resources: dict[str, int] | dict[str, list[int]], non_renewable_resources: list[str], mode_details: dict[Hashable, dict[str | int, dict[str, int]]], successors: dict[int | str, list[str | int]], horizon, special_constraints: SpecialConstraintsDescription | None = None, preemptive_indicator: dict[Hashable, bool] | None = None, relax_the_start_at_end: bool = True, tasks_list: list[int | str] | None = None, source_task=None, sink_task=None, name_task: dict[int, str] | None = None, **kwargs)[source]
Bases:
PreemptiveRcpspProblem
- evaluate(rcpsp_sol: PreemptiveRcpspSolution) 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.
- evaluate_function(rcpsp_sol: PreemptiveRcpspSolution)[source]
- 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.
- satisfy(rcpsp_sol: PreemptiveRcpspSolution)[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.rcpsp.problem_specialized_constraints.SpecialPreemptiveRcpspSolution(problem, rcpsp_permutation=None, rcpsp_schedule=None, rcpsp_modes=None, rcpsp_schedule_feasible=None, standardised_permutation=None)[source]
Bases:
PreemptiveRcpspSolution
- change_problem(new_problem: Problem)[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()[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.
- generate_schedule_from_permutation_serial_sgs_2(current_t: int = 0, completed_tasks: set[Hashable] | None = None, partial_schedule: dict[Hashable, dict[str, list[int]]] | None = None, do_fast: bool = True)[source]
- lazy_copy()[source]
This function should return a new object but possibly with mutable attributes from the original objects.
A typical use of lazy copy is in evolutionary algorithms or genetic algorithm where the use of local move don’t need to do a possibly costly deepcopy.
Returns (Solution): copy (possibly shallow) of the Solution
- discrete_optimization.rcpsp.problem_specialized_constraints.check_solution(problem: SpecialConstraintsPreemptiveRcpspProblem, solution: SpecialPreemptiveRcpspSolution | RcpspSolution | PreemptiveRcpspSolution, relax_the_start_at_end: bool = True)[source]
- discrete_optimization.rcpsp.problem_specialized_constraints.compute_constraints_details(solution: RcpspSolution | PreemptiveRcpspSolution, constraints: SpecialConstraintsDescription)[source]
- discrete_optimization.rcpsp.problem_specialized_constraints.create_np_data_and_jit_functions(rcpsp_problem: SpecialConstraintsPreemptiveRcpspProblem)[source]
- discrete_optimization.rcpsp.problem_specialized_constraints.evaluate_constraints(solution: RcpspSolution | PreemptiveRcpspSolution, constraints: SpecialConstraintsDescription)[source]
- discrete_optimization.rcpsp.problem_specialized_constraints.generate_schedule_from_permutation_serial_sgs_partial_schedule_preempptive(solution, rcpsp_problem, partial_schedule: dict[Hashable, dict[str, list[int]]], current_t, completed_tasks)[source]
- discrete_optimization.rcpsp.problem_specialized_constraints.generate_schedule_from_permutation_serial_sgs_preemptive(solution, rcpsp_problem: SpecialConstraintsPreemptiveRcpspProblem)[source]
discrete_optimization.rcpsp.sgs_without_array module
- class discrete_optimization.rcpsp.sgs_without_array.SgsWithoutArray(rcpsp_problem: RcpspProblem)[source]
Bases:
object
- static add_event_delta(sdict: SortedDict, time_start: int, delta: int, time_end: int) None [source]
- static add_event_delta_in_absolute(sdict: SortedDict, time_start: int, delta: int, time_end: int, liberate: bool = True) None [source]
- static create_absolute_dict(vector: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) SortedDict [source]
- static create_delta_dict(vector: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) SortedDict [source]
- generate_schedule_from_permutation_serial_sgs(solution: RcpspSolution, rcpsp_problem: RcpspProblem) tuple[dict[Hashable, dict[str, int]], bool, dict[str, SortedDict]] [source]
discrete_optimization.rcpsp.solution module
- class discrete_optimization.rcpsp.solution.PartialSolution(task_mode: dict[int, int] | None = None, start_times: dict[int, int] | None = None, end_times: dict[int, int] | None = None, partial_permutation: list[int] | None = None, list_partial_order: list[list[int]] | None = None, start_together: list[tuple[int, int]] | None = None, start_at_end: list[tuple[int, int]] | None = None, start_at_end_plus_offset: list[tuple[int, int, int]] | None = None, start_after_nunit: list[tuple[int, int, int]] | None = None, disjunctive_tasks: list[tuple[int, int]] | None = None, start_times_window: dict[Hashable, tuple[int, int]] | None = None, end_times_window: dict[Hashable, tuple[int, int]] | None = None)[source]
Bases:
object
- class discrete_optimization.rcpsp.solution.RcpspSolution(problem: RcpspProblem, rcpsp_permutation: list[int] | None = None, rcpsp_schedule: dict[Hashable, dict[str, int]] | None = None, rcpsp_modes: list[int] | None = None, rcpsp_schedule_feasible: bool = True, standardised_permutation: list[int] | None = None, fast: bool = True)[source]
Bases:
Solution
Solution to RcpspProblem problems.
- problem
RCPSP problem for which this is a solution
- rcpsp_permutation
Tasks permutation.
- rcpsp_schedule
Tasks schedule. ( task -> “start_time” or “end_time” -> time) Potentially only partial if not feasible with given permutation, or for aggregated models.
- rcpsp_modes
Mode used for each task. Same order as problem.tasks_list_non_dummy.
- rcpsp_schedule_feasible
False if schedule generation from permutation failed, True else.
- standardised_permutation
Permutation deduced uniquely from schedule. Can be different from rcpsp_permutation as different permutations can lead to same schedule.
- fast
boolean indicating if we us the fast functions to generate schedule from permutation.
- Parameters:
problem – RCPSP problem for which this is a solution
rcpsp_permutation – Tasks permutation. If given and schedule not given, used to reconstruct the schedule. if not given, deduced from schedule. If not given and schedule not given, it is set to problem.fixed_permutation
rcpsp_schedule – Tasks schedule. ( task -> “start_time” or “end_time” -> time) If given used to construct standardised_permutation. If given and rcpsp_permutation not given, used to construct rcpsp_permutation. If given and rcpsp_permutation given, no consistency check. If not given, deduced from rcpsp_permutation if possible. If not possible, rcpsp_schedule_feasible set to False and rcpsp_schedule set to a partially filled schedule. In case of Aggreg_RcpspModel, kept empty.
rcpsp_modes – Mode used for each task. Same order as problem.tasks_list_non_dummy. If not given we use problem.fixed_modes if existing, else 1 for each task.
rcpsp_schedule_feasible – True if a schedule can be deduced from permutation. False if it leads to incoherency preventing a schedule generation. Recomputed when schedule is (re)computed from permutation.
standardised_permutation – Permutation deduced uniquely from schedule. If given, not recomputed. Can be different from rcpsp_permutation as different permutations can lead to same schedule.
fast – boolean indicating if we us the fast functions to generate schedule from permutation.
- change_problem(new_problem: RcpspProblem) 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() RcpspSolution [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.
- generate_schedule_from_permutation_serial_sgs_2(current_t: int = 0, completed_tasks: dict[Hashable, TaskDetails] | None = None, scheduled_tasks_start_times: dict[Hashable, int] | None = None, do_fast: bool = True) None [source]
- lazy_copy() RcpspSolution [source]
This function should return a new object but possibly with mutable attributes from the original objects.
A typical use of lazy copy is in evolutionary algorithms or genetic algorithm where the use of local move don’t need to do a possibly costly deepcopy.
Returns (Solution): copy (possibly shallow) of the Solution
- discrete_optimization.rcpsp.solution.compute_mean_resource_reserve(solution: RcpspSolution, rcpsp_problem: RcpspProblem) float [source]
- discrete_optimization.rcpsp.solution.generate_schedule_from_permutation_serial_sgs(solution: RcpspSolution, rcpsp_problem: RcpspProblem) tuple[dict[Hashable, dict[str, int]], bool] [source]
- discrete_optimization.rcpsp.solution.generate_schedule_from_permutation_serial_sgs_partial_schedule(solution: RcpspSolution, rcpsp_problem: RcpspProblem, current_t: int, completed_tasks: dict[Hashable, TaskDetails], scheduled_tasks_start_times: dict[Hashable, int]) tuple[dict[Hashable, dict[str, int]], bool] [source]
- discrete_optimization.rcpsp.solution.generate_schedule_from_permutation_serial_sgs_partial_schedule_specialized_constraints(solution: RcpspSolution, rcpsp_problem: RcpspProblem, current_t: int, completed_tasks: dict[Hashable, TaskDetails], scheduled_tasks_start_times: dict[Hashable, int]) tuple[dict[Hashable, dict[str, int]], bool] [source]
- discrete_optimization.rcpsp.solution.generate_schedule_from_permutation_serial_sgs_special_constraints(solution: RcpspSolution, rcpsp_problem: RcpspProblem) tuple[dict[Hashable, dict[str, int]], bool] [source]
- discrete_optimization.rcpsp.solution.permutation_do_to_permutation_sgs_fast(rcpsp_problem: RcpspProblem, permutation_do: Iterable[int]) npt.NDArray[np.int_] [source]
discrete_optimization.rcpsp.solvers_map module
- discrete_optimization.rcpsp.solvers_map.get_solver_default_arguments(method: type[RcpspSolver] | type[GenericRcpspSolver]) dict[str, Any] [source]
- discrete_optimization.rcpsp.solvers_map.look_for_solver(domain: RcpspProblem | PreemptiveRcpspProblem | SpecialConstraintsPreemptiveRcpspProblem) list[type[RcpspSolver] | type[GenericRcpspSolver]] [source]
- discrete_optimization.rcpsp.solvers_map.look_for_solver_class(class_domain: type[RcpspProblem | PreemptiveRcpspProblem | SpecialConstraintsPreemptiveRcpspProblem]) list[type[RcpspSolver] | type[GenericRcpspSolver]] [source]
- discrete_optimization.rcpsp.solvers_map.return_solver(method: type[RcpspSolver] | type[GenericRcpspSolver], problem: RcpspProblem | PreemptiveRcpspProblem | SpecialConstraintsPreemptiveRcpspProblem, **kwargs: Any) RcpspSolver | GenericRcpspSolver [source]
- discrete_optimization.rcpsp.solvers_map.solve(method: type[RcpspSolver] | type[GenericRcpspSolver], problem: RcpspProblem | PreemptiveRcpspProblem | SpecialConstraintsPreemptiveRcpspProblem, **kwargs: Any) ResultStorage [source]
- discrete_optimization.rcpsp.solvers_map.solve_return_solver(method: type[RcpspSolver] | type[GenericRcpspSolver], problem: RcpspProblem | PreemptiveRcpspProblem | SpecialConstraintsPreemptiveRcpspProblem, **kwargs: Any) tuple[ResultStorage, RcpspSolver | GenericRcpspSolver] [source]
discrete_optimization.rcpsp.special_constraints module
- class discrete_optimization.rcpsp.special_constraints.PairModeConstraint(allowed_mode_assignment: dict[tuple[Hashable, Hashable], set[tuple[int, int]]] | None = None, same_score_mode: set[tuple[Hashable, Hashable]] | None = None, score_mode: dict[tuple[Hashable, int], int] | None = None)[source]
Bases:
object
This data structure exists to express the following constraints : if allowed_mode_assignment is not None : for each key of the dictionary (activity_1, activity_2), the allowed modes assignment to those 2 activity are listed in allowed_mode_assignment[(activity_1, activity_2)] This can be used to express that a given resource has to do both activities.
Another way of expressing the constraint is : -each interesting tuple (task,mode) is given an int score. (score_mode) -We get a set of pairs of activities (same_score_mode) : indicating that the score_mode of the 2 activity should be equal.
- class discrete_optimization.rcpsp.special_constraints.SpecialConstraintsDescription(task_mode: dict[Hashable, int] | None = None, start_times: dict[Hashable, int] | None = None, end_times: dict[Hashable, int] | None = None, start_times_window: dict[Hashable, tuple[int | None, int | None]] | None = None, end_times_window: dict[Hashable, tuple[int | None, int | None]] | None = None, partial_permutation: list[Hashable] | None = None, list_partial_order: list[list[Hashable]] | None = None, start_together: list[tuple[Hashable, Hashable]] | None = None, start_at_end: list[tuple[Hashable, Hashable]] | None = None, start_at_end_plus_offset: list[tuple[Hashable, Hashable, int]] | None = None, start_after_nunit: list[tuple[Hashable, Hashable, int]] | None = None, disjunctive_tasks: list[tuple[Hashable, Hashable]] | None = None, pair_mode_constraint: PairModeConstraint | None = None)[source]
Bases:
object
discrete_optimization.rcpsp.transform_problem module
- discrete_optimization.rcpsp.transform_problem.from_rcpsp_problem(rcpsp_problem: RcpspProblem, constraints: SpecialConstraintsDescription, preemptive=False) RcpspProblem [source]
discrete_optimization.rcpsp.utils module
- discrete_optimization.rcpsp.utils.all_diff_start_time(rcpsp_sols: tuple[RcpspSolution, RcpspSolution]) dict[Hashable, int] [source]
- discrete_optimization.rcpsp.utils.compute_graph_rcpsp(rcpsp_problem: RcpspProblem) Graph [source]
- discrete_optimization.rcpsp.utils.compute_nice_resource_consumption(rcpsp_problem: RcpspProblem, rcpsp_sol: RcpspSolution, list_resources: list[str] | None = None) tuple[dict[int, npt.NDArray[np.int_]], dict[int, npt.NDArray[np.int_]]] [source]
- discrete_optimization.rcpsp.utils.compute_resource_consumption(rcpsp_problem: RcpspProblem, rcpsp_sol: RcpspSolution, list_resources: list[str] | None = None, future_view: bool = True) tuple[npt.NDArray[np.int_], npt.NDArray[np.int_]] [source]
- discrete_optimization.rcpsp.utils.compute_schedule_per_resource_individual(rcpsp_problem: RcpspProblem, rcpsp_sol: RcpspSolution, resource_types_to_consider: list[str] | None = None) dict[str, dict[str, Any]] [source]
- discrete_optimization.rcpsp.utils.create_fake_tasks(rcpsp_problem: RcpspProblem) list[dict[str, int]] [source]
- discrete_optimization.rcpsp.utils.get_end_bounds_from_additional_constraint(rcpsp_problem: RcpspProblem, activity: Hashable) tuple[int, int] [source]
- discrete_optimization.rcpsp.utils.get_max_time_solution(solution: PreemptiveRcpspSolution | RcpspSolution) int [source]
- discrete_optimization.rcpsp.utils.get_start_bounds_from_additional_constraint(rcpsp_problem: RcpspProblem, activity: Hashable) tuple[int, int] [source]
- discrete_optimization.rcpsp.utils.get_tasks_ending_between_two_times(solution: PreemptiveRcpspSolution | RcpspSolution, time_1: int, time_2: int) list[Hashable] [source]
- discrete_optimization.rcpsp.utils.intersect(i1: Sequence[int], i2: Sequence[int]) list[int] | None [source]
- discrete_optimization.rcpsp.utils.kendall_tau_similarity(rcpsp_sols: tuple[RcpspSolution, RcpspSolution]) float [source]
- discrete_optimization.rcpsp.utils.plot_resource_individual_gantt(rcpsp_problem: RcpspProblem, rcpsp_sol: RcpspSolution, resource_types_to_consider: list[str] | None = None, title_figure: str = '', x_lim: list[int] | None = None, fig: plt.Figure | None = None, ax: npt.NDArray[np.object_] | None = None, current_t: int | None = None) plt.Figure [source]
- discrete_optimization.rcpsp.utils.plot_ressource_view(rcpsp_problem: RcpspProblem, rcpsp_sol: RcpspSolution, list_resource: list[str] | None = None, title_figure: str = '', x_lim: list[int] | None = None, fig: plt.Figure | None = None, ax: npt.NDArray[np.object_] | None = None) plt.Figure [source]
- discrete_optimization.rcpsp.utils.plot_task_gantt(rcpsp_problem: RcpspProblem, rcpsp_sol: RcpspSolution, fig: plt.Figure | None = None, ax: plt.Axes | None = None, x_lim: list[int] | None = None, title: str | None = None) plt.Figure [source]
discrete_optimization.rcpsp.utils_preemptive module
- discrete_optimization.rcpsp.utils_preemptive.compute_nice_resource_consumption(rcpsp_problem: PreemptiveRcpspProblem, rcpsp_sol: PreemptiveRcpspSolution, list_resources: list[int | str] | None = None)[source]
- discrete_optimization.rcpsp.utils_preemptive.compute_resource_consumption(rcpsp_problem: PreemptiveRcpspProblem, rcpsp_sol: PreemptiveRcpspSolution, list_resources: list[int | str] | None = None, future_view=True)[source]
- discrete_optimization.rcpsp.utils_preemptive.compute_schedule_per_resource_individual(rcpsp_problem: PreemptiveRcpspProblem, rcpsp_sol: PreemptiveRcpspSolution, resource_types_to_consider: list[str] | None = None)[source]
- discrete_optimization.rcpsp.utils_preemptive.plot_resource_individual_gantt(rcpsp_problem: PreemptiveRcpspProblem, rcpsp_sol: PreemptiveRcpspSolution, resource_types_to_consider: list[str] | None = None, title_figure='', x_lim=None, fig=None, ax=None, current_t=None)[source]
- discrete_optimization.rcpsp.utils_preemptive.plot_ressource_view(rcpsp_problem: PreemptiveRcpspProblem, rcpsp_sol: PreemptiveRcpspSolution, list_resource: list[int | str] | None = None, title_figure='', x_lim=None, fig=None, ax=None)[source]
- discrete_optimization.rcpsp.utils_preemptive.plot_task_gantt(rcpsp_problem: PreemptiveRcpspProblem, rcpsp_sol: PreemptiveRcpspSolution, fig=None, ax=None, x_lim=None, title=None, current_t=None)[source]