Changes between Version 4 and Version 5 of ValidationSimple
- Timestamp:
- May 4, 2007, 9:57:42 AM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ValidationSimple
v4 v5 9 9 * Zero on success, 10 10 * ERR_OPENDIR if there was a transient error, e.g. the output file is on a network volume that is not available. The validator will try this result again later. 11 * Any other return value indicates a permanent error. Example: an output file is missing, or has a syntax error. The result will be marked as invalid. 11 * Any other return value indicates a permanent error. Example: an output file is missing, or has a syntax error. The result will be marked as invalid. 12 12 13 {{{ 13 14 extern int compare_results( … … 23 24 extern double compute_granted_credit(WORKUNIT&, vector<RESULT>& results); 24 25 }}} 25 Given a set of results (at least one of which is valid) compute the credit to be granted to all of them. Normally this function simply returns median_mean_credit( results). If [WorkGeneration credit is specified in the workunit], call get_credit_from_wu().26 Given a set of results (at least one of which is valid) compute the credit to be granted to all of them. Normally this function simply returns median_mean_credit(wu, results). If [WorkGeneration credit is specified in the workunit], call get_credit_from_wu(wu, results). 26 27 27 28 You must link these functions with the files validator.C, validate_util.C, and validate_util2.C. The result is your custom validator. 28 Example 29 == Example == 29 30 Here's an example in which the output file contains an integer and a double. Two results are considered equivalent if the integer is equal and the doubles differ by no more than 0.01. 30 31 … … 57 58 if (retval) return retval; 58 59 n = fscanf(f, "%d %f", &i, &x); 60 fclose(f); 59 61 if (n != 2) return ERR_XML_PARSE; 60 62 DATA* dp = new DATA;