spatial_resource_aggregator¶
- class pyrecodes.resource_distribution_model.spatial_resource_aggregator.SpatialResourceAggregator¶
Bases:
objectClass 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, locality_ids=None, supply_or_demand='demand', supply_or_demand_type='OperationDemand') float¶
Aggregate the supply or demand for a resource per locality.
If locality_ids is None, it will aggregate for all localities. Otherwise, it will only aggregate for the specified localities.