spatial_resource_aggregator

class pyrecodes.resource_distribution_model.spatial_resource_aggregator.SpatialResourceAggregator

Bases: object

Class to aggregate resources for a specific spatial unit. At the moment, the spatial unit is a locality.
Used to get the water demand in a locality at different time steps to send to water flow simulators.
TODO: Maybe connect this class with the resilience calculators, as it seems to be doing something similar.
aggregate_per_locality(components: list[Component], resource_name: str, supply_or_demand='demand', supply_or_demand_type='OperationDemand') float

Aggregate the supply or demand for a resource per locality.

aggregate_total(components: list[Component], resource_name: str, supply_or_demand='demand', supply_or_demand_type='OperationDemand') float

Aggregate the total supply or demand for a resource in the system.