Cost report module¶
CostReportProtocol
¶
Bases: Protocol
A Protocol defining the properties of a report in Koswat.
Infrastructure cost calculator¶
ProfileZoneCalculator
dataclass
¶
Calculator to determine the width of zones A and B of a reinforced
profile (ReinforcementProfileProtocol). It requires its original base
profile to be in its definition.
calculate() -> tuple[float, float]
¶
Calculates the width of zones A and B for the defined instance of
ReinforcementProfileProtocol. The calculation is as follows:
- When dh0 has not varied with respect to the base profile, then zones
A and B are calculated.
- When dh0 has increased then only zone B is calculated.
| Returns: |
|
|---|
InfrastructureProfileCostsCalculator
dataclass
¶
Calculator to generate all InfrastructureLocationCosts instances
based on the locations of the contained infrastructure
(SurroundingsInfrastructure.points) and the width of zone_a and
zone_b.
calculate(zone_a_width: float, zone_b_width: float) -> list[InfrastructureLocationCosts]
¶
Calculates the costs affecting this instance's infrastructure at all points where it is present.
| Parameters: |
|
|---|
| Returns: |
|
|---|
MultiInfrastructureProfileCostsCalculator
dataclass
¶
Calculator that contains all possible "infrastructure" calculators
(InfrastructureProfileCostsCalculator) one for each of the available
infrastructures in the current KoswatScenario.
Its calculate method only requires a reinforcement
(ReinforcementProfileProtocol) to determine all infrastructures' costs.
calculate(reinforced_profile: ReinforcementProfileProtocol) -> list[InfrastructureLocationProfileCostReport]
¶
Calculates the costs related to appyling the provided reinforcement_profile
at all the locations where an infrastructure is present. It first determines
zone A and B and then provides their widths to the inner
infrastructure calculators (InfrastructureProfileCostsCalculator).
| Parameters: |
|
|---|
| Returns: |
|
|---|
MultiInfrastructureProfileCostsCalculatorBuilder
dataclass
¶
Bases: BuilderProtocol
Builder to set up "fix" information such as costs derived from the koswat
settings (InfraCostsEnum, SurtaxFactorEnum) which directly determines the
zone A and/or B costs that will be applied for each infrastructure.
Quantity cost parameters calculator¶
IO¶
Summary¶
Summary costs¶
Summary infrastructure costs¶
SummaryInfrastructureCostsCsvFomBuilder
dataclass
¶
Bases: BuilderProtocol
Summary locations¶
ClusterShpFom
dataclass
¶
base_geometry: LineString
property
¶
The resulting geometry of all locations excluding the
profile's width.
| Returns: |
|
|---|
get_buffered_geometry(width: float) -> LineString
¶
The base_geometry with an applied buffer (width) that
represents the polderside's width.
| Parameters: |
|
|---|
| Returns: |
|
|---|
new_profile_width: float
property
¶
The new polderside width.
old_profile_width: float
property
¶
The original polderside width.
ClusterCollectionShpFom
dataclass
¶
from_summary(koswat_summary: KoswatSummary, cluster_criteria: Callable[[StrategyLocationReinforcement], type[ReinforcementProfileProtocol]] = lambda x: x.current_selected_measure) -> ClusterCollectionShpFom
classmethod
¶
Maps the KoswatSummary into a file object model that can be exported into *.shp files.
| Parameters: |
|
|---|
| Returns: |
|
|---|
generate_geodataframes() -> ClusterGeoDataFrameOutputFom
¶
Generates all geodataframes of the given clusters. The generated geodataframes correspond to the, base geometry (without buffering), the old and new geometries with their profile's width being buffered to the base geometry.
| Returns: |
|
|---|
ClusterGeoDataFrameOutputFom
¶
Bases: FileObjectModelProtocol
Data structure to wrap the output generated by ClusterCollectionShpFom.generate_geodataframes.
is_valid() -> bool
¶
Checks that all GeoDataFrame properties are set.
| Returns: |
|
|---|