Analyzer#

class Analyzer(name=None, label=None, **kwargs)[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

Shortcut to self.t.now()

states

Return a flat list of all states

statesdict

Return a flat dictionary (objdict) of all states

ti

Get the current module timestep

timevec

Shortcut to self.t.timevec

Methods