Re: Arguments to FunctionDefinitions
03 Mar '12 10:25
> Andreas, Nicolas--
> Thanks very much for your suggestions!
> 1. I can't find the ASTNode.Type of LAMBDA in my download of JSBML.
Please look again, it is in this class. See also the JavaDoc:
> 2. Actually, I was looking for a way to take an input string such as "k1 * S1 * 2" such as might be entered into a text field and passing it to a form of the setMath( ) function in order to get it into the FunctionDefinition.
> However, in the absence of such a direct method, a workaround might perhaps take the form of code (I've found it in JigCell) that can convert a String such as this into MathML that I could pass to the setFormula(String formula) method.
As Nico explained, there is a method that you need: You can directly
pass such a formula String to the FunctionDefinition object (I cite a
(where fd2 is your function definition). In order to parse the formual
above, you would have to write
fd2.setFormula("lambda(k1, S1, k1 * S1 * 2)");
> 3. As for working with arguments: I've found that the following code fragment
> FormulaCompiler fc = new FormulaCompiler( );
> fc.function( fd, (java.util.List) paramList );
> where paramList is an ArrayList of ASTNodes of arguments would seem to be able to pass arguments into the function definition. Not sure how this would relate to the body of the formula, though.
The purpose of the FormulaCompiler is precisely the opposit of what you
are interested in: It generates infix formula strings from ASTNode
objects, but you want to parse these. Therefore, this method won't be
useful for your purpose.
I hope this helps clarifying FunctionDefinitions a bit.
Dr. Andreas Dräger
University of Tuebingen
Center for Bioinformatics Tuebingen (ZBIT)
To manage your jsbml-development list subscription, visit
For a web interface to the jsbml-development mailing list, visit
For questions or feedback about the jsbml-development list,
Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)