rewet_distribution_model¶
- class pyrecodes.resource_distribution_model.rewet_distribution_model.REWETDistributionModel(resource_name: str, resource_parameters: dict, components: list[Component])¶
Bases:
AbstractResourceDistributionModel
Class that connects pyrecodes with the REWET water flow simulator.- component_is_a_building(component) bool ¶
- Method to check if a component is a building.At the moment, only R2DBuilding components are considered buildings.
- distribute(time_step: int) None ¶
- distribute_water(time_step: int) None ¶
- Method to distribute water using the REWET water flow simulator.Returns a dictionary with the met demand for each building.REWET outputs met demand ratios slightly higher than 1.0 and lower than 0.0, this is normalized to the [0, 1] range.
- get_total_consumption(scope='All') float ¶
- get_total_demand(scope='All') float ¶
- get_total_supply(scope='All') float ¶
- Assume supply equal to consumption at this point. TODO: Figure out how to change later.
- update_buildings_met_demand() None ¶
- Update supply of buildings based on their met demand for water.At the moment, updates only R2DBuilding components
- update_r2d_dict()¶
- Method to update the r2d_dict based on the current state of the components.At the moment, the r2d_dict is created from scratch at each time step. Not efficient, optimize later.