Liking cljdoc? Tell your friends :D

automaton-optimization.time-based.impl.aggregates

Aggregates defines how an aggregator will be able to turn a bucket into a bucket-aggregate. It is a list of aggregate automatically sorted with their start-bucket. This list is used by a aggregator-item to create the aggregator.

See the [[aggregator]] function, for details about the aggregation rules.

Aggregates entity diagram

Aggregates defines how an `aggregator` will be able to turn a `bucket` into a `bucket-aggregate`.
It is a list of `aggregate` automatically sorted with their `start-bucket`.
This list is used by a `aggregator-item` to create the `aggregator`.

See the [[aggregator]] function, for details about the aggregation rules.

![Aggregates entity diagram](archi/time_based/aggregates.png)
raw docstring

default-start-bucket-of-first-aggregateclj/s

(default-start-bucket-of-first-aggregate aggregates)

make-aggregatorclj/s

(make-aggregator aggregates)

Creates the aggregator based on the aggregates.

  • The aggregates will be sorted with their start-bucket.
  • Default values will be added.
  • If the end-bucket of an aggregate is nil, it is defaulted to the start-bucket of the next one.

Then, for the first aggregate:

  • start-bucket-aggregate starts to 0.
  • end-bucket-aggregate is calculated based on step and start-bucket-aggregate.

For next aggregates:

  • the start-bucket-aggregate is the end-bucket-aggregate of the previous aggregate.
  • end-bucket-aggregate is calculated in the same way, except for the last one that my be nil if no end is defined.
Creates the `aggregator` based on the `aggregates`.

* The `aggregates` will be sorted with their `start-bucket`.
* Default values will be added.
* If the `end-bucket` of an aggregate is nil, it is defaulted to the `start-bucket` of the next one.

Then, for the first `aggregate`:

* `start-bucket-aggregate` starts to `0`.
* `end-bucket-aggregate` is calculated based on `step` and `start-bucket-aggregate`.

For next `aggregate`s:

* the `start-bucket-aggregate` is the `end-bucket-aggregate` of the previous `aggregate`.
* `end-bucket-aggregate` is calculated in the same way, except for the last one that my be `nil` if no end is defined.
raw docstring

remove-aggregate-wo-start-bucketclj/s

(remove-aggregate-wo-start-bucket aggregates)

validateclj/s

(validate aggregates)

Is empty if aggregates is valid. Returns errors otherwise.

Is empty if `aggregates` is valid.
Returns errors otherwise.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close