discrete_optimization.pickup_vrp package

Subpackages

Submodules

discrete_optimization.pickup_vrp.gpdp module

class discrete_optimization.pickup_vrp.gpdp.GPDP(number_vehicle: int, nodes_transportation: Set[Hashable], nodes_origin: Set[Hashable], nodes_target: Set[Hashable], list_pickup_deliverable: List[Tuple[List[Hashable], List[Hashable]]], origin_vehicle: Dict[int, Hashable], target_vehicle: Dict[int, Hashable], resources_set: Set[str], capacities: Dict[int, Dict[str, Tuple[float, float]]], resources_flow_node: Dict[Hashable, Dict[str, float]], resources_flow_edges: Dict[Tuple[Hashable, Hashable], Dict[str, float]], distance_delta: Dict[Hashable, Dict[Hashable, float]], time_delta: Dict[Hashable, Dict[Hashable, float]], time_delta_node: Dict[Hashable, float] | None = None, coordinates_2d: Dict[Hashable, Tuple[float, float]] | None = None, clusters_dict: Dict[Hashable, Hashable] | None = None, list_pickup_deliverable_per_cluster: List[Tuple[List[Hashable], List[Hashable]]] | None = None, mandatory_node_info: Dict[Hashable, bool] | None = None, cumulative_constraints: List[Tuple[Set[Hashable], int]] | None = None, time_windows_nodes: Dict[Hashable, Tuple[int | None, int | None]] | None = None, time_windows_cluster: Dict[Hashable, Tuple[int | None, int | None]] | None = None, group_identical_vehicles: Dict[int, List[int]] | None = None, slack_time_bound_per_node: Dict[Hashable, Tuple[int, float]] | None = None, node_vehicle: Dict[Hashable, List[int]] | None = None, compute_graph: bool = False)[source]

Bases: Problem

MAX_VALUE = 10000000000.0
compute_distance(path: List[Hashable]) float[source]
compute_graph() None[source]
evaluate(variable: GPDPSolution) 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_node(node_1: Hashable, node_2: Hashable) float[source]
get_attribute_register() EncodingRegister[source]

Returns how the Solution should be encoded.

Returns (EncodingRegister): content of the encoding of the solution

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(variable: GPDPSolution) 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.

update_edges() None[source]
update_graph() None[source]
class discrete_optimization.pickup_vrp.gpdp.GPDPSolution(problem: GPDP, trajectories: Dict[int, List[Hashable]], times: Dict[Hashable, float], resource_evolution: Dict[Hashable, Dict[Hashable, List[int]]])[source]

Bases: Solution

change_problem(new_problem: Problem) 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

check_pickup_deliverable() bool[source]
copy() GPDPSolution[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.

class discrete_optimization.pickup_vrp.gpdp.ProxyClass[source]

Bases: object

static from_tsp_model_gpdp(tsp_model: TSPModel2D, compute_graph: bool = False) GPDP[source]
static from_vrp_model_to_gpdp(vrp_model: VrpProblem2D, compute_graph: bool = False) GPDP[source]
discrete_optimization.pickup_vrp.gpdp.build_matrix_distance(problem: GPDP) ndarray[Any, dtype[float64]][source]
discrete_optimization.pickup_vrp.gpdp.build_matrix_time(problem: GPDP) ndarray[Any, dtype[float64]][source]
discrete_optimization.pickup_vrp.gpdp.build_pruned_problem(problem: GPDP, undirected: bool = True, compute_graph: bool = False) GPDP[source]
discrete_optimization.pickup_vrp.gpdp.max_distance(problem: GPDP) float[source]
discrete_optimization.pickup_vrp.gpdp.max_time(problem: GPDP) float[source]

Module contents