discrete_optimization.rcpsp.specialized_rcpsp package

Submodules

discrete_optimization.rcpsp.specialized_rcpsp.rcpsp_specialized_constraints module

class discrete_optimization.rcpsp.specialized_rcpsp.rcpsp_specialized_constraints.RCPSPModelSpecialConstraintsPreemptive(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[str | int] | None = None, source_task=None, sink_task=None, name_task: Dict[int, str] | None = None, **kwargs)[source]

Bases: RCPSPModelPreemptive

copy()[source]
evaluate(rcpsp_sol: RCPSPSolutionPreemptive) 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_from_encoding(int_vector, encoding_name)[source]
evaluate_function(rcpsp_sol: RCPSPSolutionPreemptive)[source]
get_dummy_solution(random_perm: bool = False)[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.

has_special_constraints()[source]
is_preemptive()[source]
lazy_copy()[source]
satisfy(rcpsp_sol: RCPSPSolutionPreemptive)[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.

update_function()[source]
update_functions()[source]
class discrete_optimization.rcpsp.specialized_rcpsp.rcpsp_specialized_constraints.RCPSPSolutionSpecialPreemptive(problem, rcpsp_permutation=None, rcpsp_schedule=None, rcpsp_modes=None, rcpsp_schedule_feasible=None, standardised_permutation=None)[source]

Bases: RCPSPSolutionPreemptive

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(do_fast=True)[source]
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.specialized_rcpsp.rcpsp_specialized_constraints.check_solution(problem: RCPSPModelSpecialConstraintsPreemptive, solution: RCPSPSolutionSpecialPreemptive | RCPSPSolution | RCPSPSolutionPreemptive, relax_the_start_at_end: bool = True)[source]
discrete_optimization.rcpsp.specialized_rcpsp.rcpsp_specialized_constraints.compute_constraints_details(solution: RCPSPSolution | RCPSPSolutionPreemptive, constraints: SpecialConstraintsDescription)[source]
discrete_optimization.rcpsp.specialized_rcpsp.rcpsp_specialized_constraints.create_np_data_and_jit_functions(rcpsp_problem: RCPSPModelSpecialConstraintsPreemptive)[source]
discrete_optimization.rcpsp.specialized_rcpsp.rcpsp_specialized_constraints.evaluate_constraints(solution: RCPSPSolution | RCPSPSolutionPreemptive, constraints: SpecialConstraintsDescription)[source]
discrete_optimization.rcpsp.specialized_rcpsp.rcpsp_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.specialized_rcpsp.rcpsp_specialized_constraints.generate_schedule_from_permutation_serial_sgs_preemptive(solution, rcpsp_problem: RCPSPModelSpecialConstraintsPreemptive)[source]

Module contents