Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » jsbml-development » Arguments to FunctionDefintions
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
Andreas Dräger


Posts: 273
Registered:
June 2006
Re: Arguments to FunctionDefinitions 03 Mar '12 10:25 Go to previous messageGo to previous message

Hi JavaBob,

> 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:
http://sbml.org/Special/Software/JSBML/build/apidocs/org/sbml/jsbml/ASTNode.Type.html#LAMBDA

> 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
previous e-mail):

fd2.setFormula("lambda(x,y,z,2)");

(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)");

That's it.

> 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.

> --JavaBob

Cheers
Andreas

--
Dr. Andreas Dräger
University of Tuebingen
Center for Bioinformatics Tuebingen (ZBIT)
Sand 1
72076 Tübingen
Germany

Phone: +49-7071-29-78982
Fax: +49-7071-29-5091
____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development

For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu

      

SubjectPosterDate
Read Message   Arguments to FunctionDefintions rbyrnes29 Feb '12 13:03
Read Message   Re: Arguments to FunctionDefinitions rbyrnes01 Mar '12 14:12
Read Message   Re: Arguments to FunctionDefinitions Andreas Dräger01 Mar '12 23:39
Read Message   Re: Arguments to FunctionDefinitions rodrigue02 Mar '12 01:19
Read Message   Re: Arguments to FunctionDefinitions rodrigue02 Mar '12 01:22
Read Message   Re: Arguments to FunctionDefinitions rodrigue02 Mar '12 01:30
Read Message   Re: Arguments to FunctionDefinitions rbyrnes02 Mar '12 09:27
Read Message   Re: Arguments to FunctionDefinitions  Andreas Dräger03 Mar '12 10:25
Read Message   Re: Arguments to FunctionDefinitions rbyrnes05 Mar '12 14:54
Read Message   Re: Arguments to FunctionDefinitions rbyrnes06 Mar '12 08:12
Read Message   Re: Arguments to FunctionDefinitions Andreas Dräger03 Mar '12 10:25
Previous Topic:JSBML modules
Next Topic:Release of SBMLsimulator 1.0-rc2
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.