I am already using Drools to do some preprocessing of an allocation problem (resources vs operations). The operations are already time intervals but I did not need to leverage the Drools Fusion features yet.
There is a new requirement for having some attributes of my resources changing over time.
I am willing to model this (the change of values over time) as "events" in Drools and take advantage of Drools Fusion, in Cloud mode.
Hence I will have to match those "dynamic" attributes events against my operations (again declared as events in Drools fusion). This will require Drools to compute a great amount of intervals overlaps.
I have several questions :
- I have found the overlap operator to be kind of counter-intuitive, and to not actually processoverlap as we usually describe it. I would expect [a;b] and [c;d] to overlap if (b > c) and (a < c). Is there a time operator for that ? Or should I use a composition of several time operators ?
- Does Drools Fusion uses any kind of internal optimization for this kind of problem ? Naively matching N intervals against M intervals would require 0(N x M) operations. I have found a way to go down to (M x log(M) + N x log(N)), by sorting the intervals beforehand : Should I prepare the pair of overlaps for Drools in advance ?
- Related to the previous question : Is there any benefit in this case (in term of performances), of using Drools Fusion instead of regular Drools together with conditions over timestamps and duration ?
Thanks for your advice
Brgds,