Skip to content

user-defined autoindex for fields #344

@gdementen

Description

@gdementen

As a follow-up to #213, we should generalize autoindex to entities fields and entire entities (i.e. all fields of an entity).

  • implement constructing a "view" of a field with its past data. Would be very slow if used during simulation but already immensely useful if used at the end of a simulation to compute aggregates over time.
  • detect fields which have at least one expression with [ ] and keep the entire array in memory instead of re-constructing it each time
  • be more clever in that detection
    • Detect if [] only refers to ids instead of periods. For example: income[10] should not keep periods in memory.
    • income[2010] should only keep the corresponding period in memory.
    • Only keep the necessary periods. For example income[period - 10:period - 1].sum() should only keep the "rolling" last 11 periods.
  • like for globals, make field_name in an expression correspond to field_name[period] but if you use field_name[something] explicitly in the expression, you are actually indexing a 2d Array instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions