Closed doorleyr closed 4 years ago
I think it makes sense to have the AggregateIndicator
class in the toolbox. Let me work on this and see if I can make it more intuitive.
If I understand correctly, we want to avoid calculating each indicator multiple times. Correct?
I'll make sure the Handler class treats compositive indicators differently.
@doorleyr check the documentation in the README under Custom Composite indicator
Thanks. This looks great but I cant test right now as cityIO is down and this method requires creating a Handler. I'll test it once cityIO is back up.
We have both regular indicators and aggregate indicators (which are calculated by aggregating some of the regular indicators). For example the Social Well Being Indicator aggregates values from the proximity indicator as well as several other indicators.
The way I've done this for now is that each indicator saves its indicator values as an attribute on each update. eg.
indicator.return_indicator(): .... self.value_indicators=list_of_computed_indicators return self.value_indicators
Then the aggregate indicator can access the saved values of the other indicators in order to update itself.
@crisjf Maybe there's a better way of doing this. Like maybe the handler is already storing the latest indicator values and the aggregate indicator should just ask it for them? Or if the way I'm currently doing it seems ok, we just need to update the innovation indicator to also save it's last state to self.value_indicators