Analyzer#

class Analyzer(name=None, label=None, unit=None, dt=None)[source]#

Bases: Module

Base class for Analyzers. Analyzers are used to provide more detailed information about a simulation than is available by default – for example, pulling states out of sim.people on a particular timestep before they get updated on the next step.

The key method of the analyzer is step(), which is called with the sim on each timestep.

To retrieve a particular analyzer from a sim, use sim.get_analyzer().

Attributes

now

Return the current time, i.e. the time vector at the current timestep.

states

Return a flat list of all states

statesdict

Return a flat dictionary (objdict) of all states

Methods