Simulation

class openfisca_core.simulations.Simulation(tax_benefit_system, simulation_json=None, debug=False, period=None, trace=False, opt_out_cache=False, memory_config=None)[source]

Represents a simulation, and handles the calculation logic

calculate(variable_name, period, **parameters)[source]

Calculate the variable variable_name for the period period, using the variable formula if it exists.

Returns:A numpy array containing the result of the calculation
get_array(variable_name, period)[source]

Return the value of variable_name for period, if this value is alreay in the cache (if it has been set as an input or previously calculated).

Unlike calculate, this method does not trigger calculations and does not use any formula.

get_holder(variable_name)[source]

Get the Holder associated with the variable variable_name for the simulation

get_memory_usage(variables=None)[source]

Get data about the virtual memory usage of the simulation