I agree with Alistair; a pattern like EventSourcing works well for building efficient query structures for a set of data along different as-yet-to-be-determined dimensions. In Pharo terms, you can implement this using a EventStream that announces new entries, then install announcement handlers each updating a dimension-specific data structure. Also makes it easy to add new dimensions if you find you need them; simply add a new handler and replay the EventStream (with the other handlers temporarily disabled). Cheers, Henry
On 23 Apr 2016, at 2:13 , Cédrick Béler <cdrick65@gmail.com> wrote:
Hi Alistair,
Thanks, this sounds like a nice suggestion.
I have to think about it. Adding altitude would be also interesting in some cases but not as a start (quite limited usage).
When you say to package it separately, youâre talking about Geolocation, Spatiotemporal classes ? or also the collection ? I can try something but I think this will deserve more « computational thinking » power than I have ^^
Cheers,
Cédrik
Le 23 avr. 2016 à 13:57, Alistair Grant <akgrant0710@gmail.com <mailto:akgrant0710@gmail.com>> a écrit :
I don't have a data structures book handy, but how about 3 SortedCollections? (Assuming 3 dimensions: latitude, longitude & time).
It would support a reasonably efficient binary search, and allow for areas and time ranges.
Regardless of which solution you choose I agree that it would be a useful general class, so please package it separately.
Cheers, Alistair (Sent from my mobile)
On 23/04/2016 1:47 PM, "Cédrick Béler" <cdrick65@gmail.com <mailto:cdrick65@gmail.com>> wrote: A dictionary with keys being the timestamp or the spatiotemporal object would probably do it... I think Iâll do that but I wonder if there are better solutions out there ^^.
Cheers,
Cédrik