BaseConcept.Finalize()
Method used to call the evaluation of an object. Once you have used the new function on a KML object, defined its inputs, you can use Finalize to execute the rules. This method proves useful if you must access an object in a Rule and the output attributes.
Note:
This method may not evaluate the object if all logical inputs are not valuated when it is called.
Signature
BaseConcept.Finalize()
Example
Concept Adder : BaseConcept
{
Object: VoidType;
Attributes
{
Inputs
{
Integer a;
Integer b;
}
}
}
Concept AdderOfAdder : BaseConcept
{
Object : VoidType;
Attributes
{
Inputs
{
Integer in1;
Integer in2;
Integer in3;
Integer in4;
}
Outputs
{
Integer outAdder;
}
}
Children
{
Adder firstAdder;
Adder secondAdder;
}
Rules
{
Rule
{
/* First case, finalize is done automatically by "new"
because all inputs are valuated within the free arguments */
firstAdder = new("Adder","firstAdder",this,in1,in2)
secondAdder = new("Adder","secondAdder",this)
/* No input is given within the free arguments */
secondAdder.a = in3
secondAdder.b = in4
secondAdder.Finalize() /* Necessary to compute the result if we
want to access it in this rule */
outAdder = firstAdder.result + secondAdder.result
}
}
}