education_recorder#

class education_recorder(**kwargs)[source]#

Bases: Analyzer

Analyzer records all education attributes of females + pregnancy + living status for all timesteps. Made for debugging purposes.

Parameters:
  • args (list) – additional timestep(s)

  • kwargs (dict) – passed to Analyzer()

Methods

apply(sim)[source]#

Apply snapshot at each timestep listed in timesteps and save result at snapshot[str(timestep)]

finalize(sim=None)[source]#

Process data in snapshots so we can plot it easily

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

Plots time series of each state as a line graph :type index: :param index: index of the female individual, must be less the analyzer’s max_pop_size

plot_waterfall(max_timepoints=30, min_age=18, max_age=40, fig_args=None, pl_args=None)[source]#

Plot a waterfall plot showing the evolution of education objective and attainment over time for a specified age group.

Parameters:
  • max_timepoints (int, optional) – The maximum number of timepoints to plot, defaults to 30.

  • min_age (int, optional) – The minimum age for the age group, defaults to 18.

  • max_age (int, optional) – The maximum age for the age group, defaults to 20.

Returns:

figure handle

The function generates uses kernel density estimation to visualize the data. If there’s not data for the min max age specified, for a specific time step (ie, there are no agents in that age group), it adds a textbox. This is an edge case that can happen for a simulation with very few agents, and a very narrow age group.