Hi,
The valid flag of any value is set if the value was successfully computed. That happens when the
set_output(NAME_OF_VALUE, 42)
inside any processor is called. That means, if the value has no valid flag set, it was not successfully computed.
Usually, processors are written in a way that they check for the requirements of a computation
if (input_valid(NAME_OF_NECESSARY_INPUT_1) && input_valid(NAME_OF_NECESSARY_INPUT_2))
{
double input1 = input_value(NAME_OF_NECESSARY_INPUT_1);
double input2 = input_value(NAME_OF_NECESSARY_INPUT_2);
double result = f(input1,input2);
set_output(NAME_OF_RESULT, result);
}
This guarantees to have only meaningful information propagating along the graph. You can try to track down in which processor the information is missing. With that information I could give a more detailed answer.
In general you can try if it is possible to write a more sophisticated algorithm, such as this:
if (input_valid(NAME_OF_NECESSARY_INPUT_1) && input_valid(NAME_OF_NECESSARY_INPUT_2))
{
double input1 = input_value(NAME_OF_NECESSARY_INPUT_1);
double input2 = input_value(NAME_OF_NECESSARY_INPUT_2);
double result = f(input1,input2); // f is an algorithm that calculates the result from the two given numbers
set_output(NAME_OF_RESULT, result);
}
else if (input_valid(NAME_OF_NECESSARY_INPUT_1))
{
double input1 = input_value(NAME_OF_NECESSARY_INPUT_1);
// make a clever computation that needs only one of the values
double result = f2(input1); // f2 is a sophisticated algorithm that calculates the result only with one number
set_output(NAME_OF_RESULT, result);
}
else if (input_valid(NAME_OF_NECESSARY_INPUT_2))
{
double input2 = input_value(NAME_OF_NECESSARY_INPUT_2);
// make a clever computation that needs only the other value
double result = f3(input2); // f3 is a sophisticated algorithm that calculates the result only with one number
set_output(NAME_OF_RESULT, result);
}
Best regards,
Michael
[Updated on: Fri, 19 August 2016 15:04]
Report message to a moderator