pyorps.utils.neighborhood
PYORPS: An Open-Source Tool for Automated Power Line Routing
References: [1] Hofmann, M., Stetz, T., Kammer, F., Repo, S.: ‘PYORPS: An Open-Source Tool for
Automated Power Line Routing’, CIRED 2025 - 28th Conference and Exhibition on Electricity Distribution, 16 - 19 June 2025, Geneva, Switzerland
- [2] Goodchild, M. F.: ‘An evaluation of lattice solutions to the problem of corridor
location’, Environment and Planning A: Economy and Space, 1977, 9, (7), pp 727-738
Functions
|
Calculate elongation error and maximum deviation for a given set of directions and path angle. |
|
Calculate the elongation error for a lattice path using Goodchild's formulation. |
|
Find the adjacent directions θ_j and θ_{j+1} such that θ_j < φ < θ_{j+1}. |
|
Find the maximum elongation error and maximum deviation for a given set of directions. |
|
Get all possible move directions in radians for a given move set. |
|
Generate the steps for a k-neighborhood. |
|
Calculate the maximum deviation for a lattice path using Goodchild's formulation. |
|
Normalize an angle to the range [0, 2π). |
- pyorps.utils.neighborhood.get_neighborhood_steps(k, directed=True)[source]
Generate the steps for a k-neighborhood.
- Parameters:
- Returns:
A numpy array with dtype int8 containing all steps
- Return type:
np.ndarray
References
[1]
- pyorps.utils.neighborhood.get_move_directions(moves)[source]
Get all possible move directions in radians for a given move set.
- Parameters:
moves (np.ndarray) – Array of move vectors
- Returns:
A sorted list of angles in radians [0, 2π)
- Return type:
List[float]
- pyorps.utils.neighborhood.find_adjacent_directions(phi, directions)[source]
Find the adjacent directions θ_j and θ_{j+1} such that θ_j < φ < θ_{j+1}.
- pyorps.utils.neighborhood.elongation_error(theta_j, theta_j_plus_1, phi)[source]
Calculate the elongation error for a lattice path using Goodchild’s formulation.
The elongation error is given by: e(φ) = (sin(θ_{j+1} - φ) + sin(φ - θ_j)) / sin(θ_{j+1} - θ_j)
- Parameters:
- Returns:
The elongation error
- Return type:
References
[2]
- pyorps.utils.neighborhood.max_deviation(theta_j, theta_j_plus_1, phi)[source]
Calculate the maximum deviation for a lattice path using Goodchild’s formulation.
The maximum deviation is given by: δ(φ) = (sin(θ_{j+1} - φ) * sin(φ - θ_j)) / sin(θ_{j+1} - θ_j)
- Parameters:
- Returns:
The maximum deviation
- Return type:
References
[2]
- pyorps.utils.neighborhood.calculate_errors(directions, phi)[source]
Calculate elongation error and maximum deviation for a given set of directions and path angle.
- Parameters:
- Returns:
A dictionary with the calculated errors
- Return type:
References
[2]