class openfisca_core.simulation_builder.SimulationBuilder[source]
build_default_simulation(tax_benefit_system, count=1)[source]
Build a simulation where:
  • There are count persons
  • There are count instances of each group entity, containing one person
  • Every person has, in each entity, the first role
build_from_dict(tax_benefit_system, input_dict)[source]

Build a simulation from input_dict

This method uses build_from_entities if entities are fully specified, or build_from_variables if not.

Parameters:input_dict (dict) – A dict represeting the input of the simulation
Returns:A Simulation
build_from_entities(tax_benefit_system, input_dict)[source]

Build a simulation from a Python dict input_dict fully specifying entities.


>>> simulation_builder.build_from_entities({
    'persons': {'Javier': { 'salary': {'2018-11': 2000}}},
    'households': {'household': {'parents': ['Javier']}}
build_from_variables(tax_benefit_system, input_dict)[source]

Build a simulation from a Python dict input_dict describing variables values without expliciting entities.

This method uses build_default_simulation to infer an entity structure


>>> simulation_builder.build_from_variables(
    {'salary': {'2016-10': 12000}}
explicit_singular_entities(tax_benefit_system, input_dict)[source]

Preprocess input_dict to explicit entities defined using the single-entity shortcut


>>> simulation_builder.explicit_singular_entities(
    {'persons': {'Javier': {}, }, 'household': {'parents': ['Javier']}}
>>> {'persons': {'Javier': {}}, 'households': {'household': {'parents': ['Javier']}}