From GridLAB-D Wiki
Jump to: navigation, search

collector - Data aggregation recording

Synopsis

module tape;
object collector {
  name collector-name;
  group class=class-name;
  property aggregator(property)[,...];
  file "file-name";
  flush -1; //  New in 3.1! 
   TODO:  // other properties may not be documented
}

Remarks

Collectors are different from recorders in that they aggregate multiple object properties into a single value. They do not use the parent property but instead use the group property to form a collection of objects over which the aggregate is taken.

Property

The group property specifies the grouping rule for creating the collection. Groups may be specified using any registered property of the object, such as class, size, parent, id, or rank. The property value is aggregated as a minimum, maximum, count, average, standard deviation, mean, variance (2nd moment), mean bias error (1st moment), or kurtosis (3rd moment). If the property is a complex number, the property must be specified in the form

property.part

where part is real, imag (for imaginary), mag for magnitude, ang for the angle in degrees, or arg for angle in radians.

For example, a collector over all water heater objects might aggregate the power property using

count(power),min(power),max(power),std(power)

which would print the number of water heaters, the minimum power used by any one water heater, the maximum power used, and the standard deviation of the power used by the set of water heaters.

Aggregating options are min, max, count, avg, std, mean, var, mbe, kur, sum, prod, skew, and gamma. (As of revision 3320, kur and skew remain unimplemented, and will tell you so if you try to use them).

Flush

By default the output buffer is flushed to disk when it is full (the size of the buffer is system specific). This default corresponds to the flush value -1. If flush is set to 0, the buffer is flushed every time a record is written. If flush is set to a value greater than 0, the buffer is flushed whenever the condition clock mod flush == 0 is satisfied.


See also