Households

class Households(model, agents, reduncancy)[source]
assign_household_attributes()[source]

Household locations are already sampled from population map in GEBModel.setup_population().

These are loaded in the spinup() method. Here we assign additional attributes (dummy data) to the households that are used in the decision module.

change_household_locations()[source]

Change the location of the household points to the centroid of the buildings.

Also, it associates the household points with their postal codes. This is done to get the correct geometry for the warning function

create_damage_probability_maps()[source]

Creates an object-based (buildings) probability map based on the ensemble of damage maps.

decide_household_strategy()[source]

This function calculates the utility of adapting to flood risk for each household and decides whether to adapt or not.

flood(flood_map)[source]

This function computes the damages for the assets and land use types in the model.

Parameters:

flood_map (DataArray) – The flood map containing water levels for the flood event.

Return type:

float

get_flood_risk_information_damage_scanner()[source]

Initiate flood risk information for each household.

This information is used in the decision module. For now also only dummy data is created.

load_flood_maps()[source]

Load flood maps for different return periods. This might be quite ineffecient for RAM, but faster then loading them each timestep for now.

warning_communication(target_households)[source]

Communicates the warning to households based on the communication efficiency.

changes risk perception –> to be moved to the update risk perception function; and return the number of households that were warned

water_demand()[source]

Calculate the water demand per household in m3 per day.

This function uses a multiplier to calculate the water demand for for each region with respect to the base year.

from_landuse_raster_to_polygon(mask, transform, crs)[source]

Convert raster data into separate GeoDataFrames for specified land use values.

Parameters:
  • mask – A 2D numpy array representing the land use raster, where each unique value corresponds to a different land use type.

  • transform – A rasterio Affine transform object that defines the spatial reference of the raster.

  • crs – The coordinate reference system (CRS) to use for the resulting GeoDataFrame.

Returns:

A GeoDataFrame containing polygons for the specified land use values.

Return type:

GeoDataFrame