NAME

Schedule::Activity::Attribute::Report - Helpers to construct attribute reports

SYNOPSIS

my $reporter=Schedule::Activity::Attribute::Report->new(%schedule);
print $reporter->report(type=>'grid',values=>'avg',steps=>10,header=>1,names=>1,fmt=>'%0.4g',sep=>"\t");

DESCRIPTION

A collection of functions to convert attribute reporting history into useful output. Reports may include overall values, time-based grids, activity-based grids, and support different output formats.

Note: Not every option is currently supported.

GENERAL OPTIONS

Values are output with the numeric format specified in fmt, default %0.4g. Columns are separated by sep, default tab.

Pass names=1 to include a column for the attribute names. This option permits concatenating columns from multiple grids when set to zero. This is on by default.

Pass header=1 to include a header row. This option permits concatenating rows from multiple grids when set to zero. This is on by default.

GRIDS

Report grids can be generated with type=grid. The values are either 'avg' for averages, or 'y' for the raw attribute values; each is determined via linear interpolation between attribute history points.

Columns

Pass steps=10 or any number to specify the number of columns for a time-based grid between the start and maximum time values in the schedule.

SUMMARY VALUES

Specifying type=summary gives only two-column output of the final 'avg' or 'y' value for the attribute at the end of the schedule.

FORMATS

Passing format=text will produce newline-separated rows as a string. This is the default.

Passing format=table will return an array reference containing the formatted table entries.

Passing format=hash will return a hash reference with entries attribute{values}{time}=value. The attribute is the name of the attribute. The nested key will be either "avg" or "y" as selected by the values parameter. The time/value key-value will be equivalent to the table values from the report, not the full attribute history.

Passing format=plot will return multi-column time series data with the labels in the first row (if enabled), using sep as the column separator, suitable for use with plotting tools. For example, with gnuplot:

plot for [n=2:3] 'attributes.dat' using 1:n with linespoints title columnheader(n)