-
Notifications
You must be signed in to change notification settings - Fork 18
user-defined autoindex for fields #344
Copy link
Copy link
Open
Description
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.
- Detect if [] only refers to ids instead of periods. For example:
- like for globals, make
field_namein an expression correspond tofield_name[period]but if you usefield_name[something]explicitly in the expression, you are actually indexing a 2d Array instead.
Reactions are currently unavailable