Koswat dike surroundings¶
KoswatSurroundingsProtocol
¶
Bases: Protocol
Empty interface to represent the Koswat surroundings and easily identify them throughout the solution.
SurroundingsInfrastructure
dataclass
¶
Bases: KoswatSurroundingsProtocol
Defines surroundings point collections that can be repaired or replaced.
The PointSurroundings contain a matrix (dictionary) where the keys
represent the distances to an obstacle, and the values a float representing
how long that infrastructure is.
SurroundingsObstacle
dataclass
¶
Bases: KoswatSurroundingsProtocol
Defines surroundings point collections that cannot be repaired or replaced.
The PointObstacleSurroundings contain the closest distance to an obstacle
both inside and outside the polder.
Point¶
PointSurroundings
dataclass
¶
Object representing a meter with x, y coordinates in a polder (or else).
__eq__(__value: object) -> bool
¶
Overriding of the "magic" equality operator required
so that PointSurroundings can be used as a key in a python dict.
__hash__() -> int
¶
Overriding of the "magic" hash operator required
so that PointSurroundings can be used as a key in a python dict.
get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float]
¶
Gets the total infrastructure width at each of the provided zones
zone_limit_collection (tuple[float, float]).
The zone limits are matched by rounding up their upper limit to the
surroundings_matrix keys (distances to the location in the real world).
When two zones have overlapping limits (as expected) the lower one will
"claim" the corresponding surrounding distance.
Example
zone_limit_collection= (0, 4), (4, 11)surroundings_matrix= {5: 1.5, 10: 3, 15: 6}- "Taken" distances per zone:
(0, 4)takes key5.(4, 11)takes key(s)10and15because5was already taken.
- Total infrastructure width at zones =
(1.5, 9)
| Returns: |
|
|---|
merge(other: PointSurroundings) -> None
¶
Merges another PointSurroundings into this one by updating the
surroundings_matrix with the values from the other one.
| Parameters: |
|
|---|
PointSurroundingsListBuilder
dataclass
¶
Bases: BuilderProtocol
Builds a collection of points (list[PointSurroundings]) given the dike locations
(KoswatDikeLocationsShpFom) and the surroundings around it
(KoswatSurroundingsCsvFom).
Wrapper¶
SurroundingsWrapper
dataclass
¶
get_locations_at_safe_distance(distance: float) -> list[PointSurroundings]
¶
Gets all locations which are safe from obstacle surroundings in a radius of distance.
| Parameters: |
|
|---|
| Returns: |
|
|---|
ObstacleSurroundingsWrapper
dataclass
¶
Bases: BaseSurroundingsWrapper
get_locations_at_safe_distance(distance: float) -> list[PointSurroundings]
¶
Gets all locations which are safe from obstacle surroundings in a radius of distance.
| Parameters: |
|
|---|
| Returns: |
|
|---|
obstacle_locations: list[PointObstacleSurroundings]
property
¶
Overlay of locations of the different ObstacleSurroundings that are present.
Buildings need to be present as input (leading for location coordinates).
Each location represents 1 meter in a real scale map.
| Returns: |
|
|---|