At the time a DIET service is defined, an aggregation method - the logical mechanism by which SeD responses are sorted - is associated with the service; the default behavior was described in Section 8.2.
If application-specific data are supplied (i.e., the estimation function has been redefined), an alternative method for aggregation is needed. Currently, a basic priority scheduler has been implemented, enabling an application developer to specify a series of performance values that are to be optimized in succession. A developer may implement a priority scheduler using the following interface:
int diet_aggregator_set_type(diet_aggregator_desc_t* agg,
int diet_aggregator_priority_max(diet_aggregator_desc_t* agg,
int diet_aggregator_priority_min(diet_aggregator_desc_t* agg,
int diet_aggregator_priority_maxuser(diet_aggregator_desc_t* agg,
int diet_aggregator_priority_minuser(diet_aggregator_desc_t* agg,
To define the tags and the order in which they should be compared, four functions are introduced. These functions, of the form diet_aggregator_priority_*, serve to identify the estimation values to be optimized during the aggregation phase. The _min and _max forms indicate that a standard performance metric (e.g., time elapsed since last execution, from the diet_estimate_lastexec function) is to be either minimized or maximized, respectively. Similarly, the _minuser and _maxuser forms indicate the analogous operations on user-supplied estimation values. Calls to these functions indicate the order of precedence of the tags.
Each time two server responses need to be compared, the values associated with the tags specified in the priority aggregator are retrieved. In the specified order, pairs of corresponding values are successively compared, passing to the next tag only if the values for the current tag are identical. If one server response contains a value for the metric currently being compared, and another does not, the response with a valid value will be selected. If at any point during the treatment of tags both responses lack the necessary tag, the comparison is declared indeterminate. This process continues until one response is declared superior to the other, or all tags in the priority aggregator are exhausted (and the responses are judged equivalent).