charles-river-analytics / figaro

Figaro Programming Language and Core Libraries
Other
757 stars 153 forks source link

Using ElementCollection.get in particle filtering grows the size of static universes #154

Open bruttenberg opened 10 years ago

bruttenberg commented 10 years ago

In particle filtering, it is common to get an element from the static universe. This is usually accomplished by calling get(Reference) on the static universe, which creates a SingleValuedReference for the reference on the static universe. The problem is that if this is done at each time step, a single value reference is added to the static universe at each time step, growing the number of elements in the universe. This is problematic since we could end up with a lot reference elements that are no longer needed.

I'm not sure of the solution yet, but in the interim, exposing the getElementByReference can help solve the problem, though it is not really correct Figaro semantics.

apfeffer commented 10 years ago

Need to memoize ElementCollection.get

apfeffer commented 9 years ago

Which universe is get defined in? Is it the universe of the element collection on which you're getting the reference or the universe calling get?

  1. Make get caching.
  2. Run all the tests and see if any assumptions have been violated.
  3. Replace getElementByReference with get in all the dynamic models and see if they work correctly.
apfeffer commented 8 years ago

@mreposa Please check whether this issue still holds.