8.3.1.2. parameter declaration

The class definition gives information neither about the input or output number nor about parameter order. These information have to be added to link with TDataServer and TMaster definitions. We use the addInput and addOutput method with TAttribute objects as argument to do so. Inputs and outputs have to be added in correct order. Here is an example of how to precise inputs and outputs, from the script in Relauncher abstraction levels:

    // problem variables
    TAttribute x("x", -3.0, 3.0),
               y("y", -4., 6.),
               ros("rose");

    // user evaluation function
    TCIntEval eval("rosenbrock");
    eval.addInput(&x); // Adding attribute in the correct order
    eval.addInput(&y);
    eval.addOutput(&ros);

For a more user friendly definition, you can use the setInputs and setOutputs methods. Instead of only requesting a pointer to the attribute under consideration, a first compulsory argument is an integer that equals the number of attributes to come, followed by as many pointers to attribute. Taking the example provided above, one can create a second assessor, using theses methods instead of the addInput and addOutput ones.

    // user evaluation function
    TCIntEval eval2("rosenbrock");
    eval2.setInputs(2,&x,&y); // Adding attributes in the correct order, all at once
    eval2.setOutputs(1,&ros);