Download Full Paper

Transcript
CHAPTER 4. ADVANCED TOPICS
then variable $row will be an array of size six and each value of a field can be
accessed with $row["<fieldName>"] in the script; <fieldName> can be best,
cycle,steps time, or k_var. The value of field best is accessed with command
$row["best"]. Additional to the fields from a line, which might differ from line to
lone, the array in $row contains an element named try whose value is the number of
the try block that is currently processed. This value is accessed with $row["try"].
Individual values calculated by a script can be added to the data structure $row,
too, by just assigning them with a conventional array element assignment operator
(see PHP manual [54]). That way, field values can be reassigned and new, derived
fields can be created on scratch.
• $lastrow
This variable works the same way as variable $row except that it holds the data
from the last line that was scanned. If the first row of a try block is currently
processed, this data structure contains no data, i.e. will be an empty array. After having ended to scan a try block this variable will hold the results of the
last line scanned in this last try block, e.g. if accessed just after execution of a
begineachrow{ – }endeachrow block.
• $try
This variable contains the number of the try block currently processed in a
begineachtry{ – }endeachtry block.
• addresult(<dataset>)
As mentioned before, the results of scanning lines of try blocks will be stored in
predefined variables $row and $lastrow. Before assigning a new value to these
variables when scanning the next line, the old results should be stored. Command
addresult(<dataset>) does exactly this. It adds any variable <dataset> to the
internal evaluation structure hold by variable $result that stores all information
extracted for later use with the compute or list commands as described later.
Recall that each line can consist of several name value pairs. Hence, the variable
added here must be an array of key value pairs. Typically, variables $row and
$lastrow are entered with this command.
• $perfMeasures
Variable $perfMeasures is an array of strings whose elements hold the names of
a performance measures the script is supposed to extract. At the beginning of the
script this variable will be set by default to hold the names of the performance
measures as exported by the command line interface definition of the last module
of the job’s algorithm. Since variable $perfMeasures might have to be changed
during the script, it is a good idea to save the contents in another variable before starting any other computation. When scanning the job result, only those
198