empowerment_recorder#

class empowerment_recorder(bins=None)[source]#

Bases: Analyzer

Records timeseries of empowerment attributes for different age groups.
  • For boolean attributes it computes the percentage returns percentage.

  • For float attributes it computes the median of the attribute from the population of interes

self.bins#

A list of ages, default is a sequence from 0 to max_age + 1.

self.keys#

A list of people’s empowerment attributes.

self.data#

A dictionary where self.data[attribute] is a a matrix of shape (number of timesteps, number of bins - 1) containing age pyramid data.

Methods

initialize(sim)[source]#

Initializes self.keys from sim.people

apply(sim)[source]#

Records histogram of empowerment attribute of all alive female individuals

plot(to_plot=None, fig_args=None, pl_args=None)[source]#

Plot all keys in self.keys or in to_plot as a heatmaps