Boost logo

Boost Users :

Subject: Re: [Boost-users] ICL library usage for interval map
From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2011-06-06 09:09:56


Hi Dece,

2011/6/6 Dave <decebel_at_[hidden]>:
> Thank you for replying. I think I should have explained in a little
> detail on my requirement.
>
> I have fixed interval, lets say, 10 minutes each over which I want to
> perform some analytics.
> In each of these ten minute intervals I will have clients add some
> items to their shopping cart, browse certain products,  read some
> reviews etc etc and I would like to track and analyze and ICL
> interval_map seems like an ideal container for my use case.
>
>
> So, I create an interval map from my 10 minute interval example,  with
> keys as shown below
> { [0,10], (10, 20], (20, 30) }
> and I would like to use a container such as a vector<ShoppingItem> as
> values in my key-value pair for each 10 minute interval key.
> Something like the below map:
> [0, 10] => vector<ShoppingItem>
> [10, 20] => vector<ShoppingItem>
> [20, 30] => vector<ShoppingItem>
>
>
> Now, lets say, we have a client "A" coming in and shopping in the
> interval (3, 5).
> I would like to add the number of items shopped in the interval [0,10]
> instead of the intervals getting splitted from [0, 10] to {[0, 3],
> [3,5], [5, 10]}
> Basically any number of users arriving in any sub interval of  [0, 10]
> should remain in [0, 10].
> Finally, I get to perform all my analytics on the vector<ShoppingItem>
> for the interval [0, 10] instead of the sub-intervals of the
> individual clients.

this is understood... Interesting use case. First a question:

Is it possible that you have to insert shopping items for an interval
that is not completely contained in one of your 10 minute intervals
but ranges across 2 or more of them. If so, how should the interval
container work in this case?

Regards,
Joachim

-- 
Interval Container Library [Boost.Icl]
http://www.joachim-faulhaber.de

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net