当前位置: 首页>>代码示例>>C#>>正文


C# libsbmlcs.ASTNode类代码示例

本文整理汇总了C#中libsbmlcs.ASTNode的典型用法代码示例。如果您正苦于以下问题:C# ASTNode类的具体用法?C# ASTNode怎么用?C# ASTNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ASTNode类属于libsbmlcs命名空间,在下文中一共展示了ASTNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: test_InitialAssignment_setMath2

 public void test_InitialAssignment_setMath2()
 {
     ASTNode math = new  ASTNode(libsbml.AST_DIVIDE);
       int i = E.setMath(math);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       assertEquals( false, E.isSetMath() );
       math = null;
 }
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:8,代码来源:TestInitialAssignment_newSetters.cs

示例2: test_Constraint_setMath2

 public void test_Constraint_setMath2()
 {
     ASTNode math = new  ASTNode(libsbml.AST_TIMES);
       int i = C.setMath(math);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       assertEquals( false, C.isSetMath() );
       math = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:8,代码来源:TestConstraint_newSetters.cs

示例3: test_ValidASTNode_binary

 public void test_ValidASTNode_binary()
 {
     ASTNode n = new ASTNode(libsbml.AST_DIVIDE);
       assertEquals( false, (n.isWellFormedASTNode()) );
       ASTNode c = libsbml.parseFormula("c");
       n.addChild(c);
       assertEquals( false, (n.isWellFormedASTNode()) );
       ASTNode d = libsbml.parseFormula("d");
       n.addChild(d);
       assertEquals( true, n.isWellFormedASTNode() );
       n = null;
 }
开发者ID:,项目名称:,代码行数:12,代码来源:

示例4: test_ASTNode_addSemanticsAnnotation

 public void test_ASTNode_addSemanticsAnnotation()
 {
     XMLNode ann = new XMLNode();
       ASTNode node = new  ASTNode();
       int i = 0;
       i = node.addSemanticsAnnotation(ann);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getNumSemanticsAnnotations() == 1 );
       i = node.addSemanticsAnnotation(null);
       assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED );
       assertTrue( node.getNumSemanticsAnnotations() == 1 );
       node = null;
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:13,代码来源:TestASTNode.cs

示例5: test_ValidASTNode_lambda

 public void test_ValidASTNode_lambda()
 {
     ASTNode n = new ASTNode(libsbml.AST_LAMBDA);
       assertEquals( false, (n.isWellFormedASTNode()) );
       ASTNode c = libsbml.parseFormula("c");
       n.addChild(c);
       assertEquals( true, n.isWellFormedASTNode() );
       ASTNode d = libsbml.parseFormula("d");
       n.addChild(d);
       assertEquals( true, n.isWellFormedASTNode() );
       ASTNode e = libsbml.parseFormula("e");
       n.addChild(e);
       assertEquals( true, n.isWellFormedASTNode() );
       n = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:15,代码来源:TestValidASTNode.cs

示例6: test_Rule_setMath1

 public void test_Rule_setMath1()
 {
     ASTNode math = new  ASTNode(libsbml.AST_TIMES);
       ASTNode a = new  ASTNode();
       ASTNode b = new  ASTNode();
       a.setName( "a");
       b.setName( "b");
       math.addChild(a);
       math.addChild(b);
       string formula;
       ASTNode math1;
       int i = R.setMath(math);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( true, R.isSetMath() );
       math1 = R.getMath();
       assertTrue( math1 != null );
       formula = libsbml.formulaToString(math1);
       assertTrue( formula != null );
       assertTrue((  "a * b" == formula ));
       math = null;
 }
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:21,代码来源:TestRule_newSetters.cs

示例7: test_ASTNode_addChild1

 public void test_ASTNode_addChild1()
 {
     ASTNode node = new  ASTNode();
       ASTNode c1 = new  ASTNode();
       ASTNode c2 = new  ASTNode();
       ASTNode c1_1 = new  ASTNode();
       int i = 0;
       node.setType(libsbml.AST_LOGICAL_AND);
       c1.setName( "a");
       c2.setName( "b");
       node.addChild(c1);
       node.addChild(c2);
       assertTrue( node.getNumChildren() == 2 );
       assertTrue((  "and(a, b)" == libsbml.formulaToString(node) ));
       c1_1.setName( "d");
       i = node.addChild(c1_1);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getNumChildren() == 3 );
       assertTrue((  "and(a, b, d)" == libsbml.formulaToString(node) ));
       assertTrue((  "a" == node.getChild(0).getName() ));
       assertTrue((  "b" == node.getChild(1).getName() ));
       assertTrue((  "d" == node.getChild(2).getName() ));
       node = null;
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:24,代码来源:TestASTNode.cs

示例8: multiplyAssignmentsToSIdByFunction

 /** */
 /* libsbml-internal */
 public new void multiplyAssignmentsToSIdByFunction(string id, ASTNode function)
 {
     libsbmlPINVOKE.KineticLaw_multiplyAssignmentsToSIdByFunction(swigCPtr, id, ASTNode.getCPtr(function));
     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
 }
开发者ID:kirichoi,项目名称:roadrunner,代码行数:7,代码来源:KineticLaw.cs

示例9: setMath

 /**
    * Sets the mathematical expression of this KineticLaw instance to a copy
    * of the given ASTNode.
    *
    * This is fundamentally identical to
    * @if java KineticLaw::setFormula(String formula)@else getFormula()@endif.
    * The latter is provided principally for compatibility compatibility with
    * SBML Level 1, which represented mathematical formulas in text-string
    * form.
    *
    * @param math an ASTNode representing a formula tree.
    *
    * *
  * @return integer value indicating success/failure of the
  * function.  @if clike The value is drawn from the
  * enumeration #OperationReturnValues_t. @endif The possible values
  * returned by this function are:
  *
  *
    * @li @link libsbml#LIBSBML_OPERATION_SUCCESS [email protected]
    * @li @link libsbml#LIBSBML_INVALID_OBJECT [email protected]
    *
    * @see setFormula(string formula)
    */
 public int setMath(ASTNode math)
 {
     int ret = libsbmlPINVOKE.KineticLaw_setMath(swigCPtr, ASTNode.getCPtr(math));
     return ret;
 }
开发者ID:kirichoi,项目名称:roadrunner,代码行数:29,代码来源:KineticLaw.cs

示例10: setMath

 /**
    * Sets the 'math' subelement of this FunctionDefinition to the Abstract
    * Syntax Tree given in @p math.
    *
    * @param math an AST containing the mathematical expression to
    * be used as the formula for this FunctionDefinition.
    *
    * @return integer value indicating success/failure of the
    * function.  @if clike The value is drawn from the
    * enumeration #OperationReturnValues_t. @endif The possible values
    * returned by this function are:
    * @li @link libsbmlcs#LIBSBML_OPERATION_SUCCESS [email protected]
    * @li @link libsbmlcs#LIBSBML_INVALID_OBJECT [email protected]
    */
 public int setMath(ASTNode math)
 {
     int ret = libsbmlPINVOKE.FunctionDefinition_setMath(swigCPtr, ASTNode.getCPtr(math));
     return ret;
 }
开发者ID:kirichoi,项目名称:roadrunner,代码行数:19,代码来源:FunctionDefinition.cs

示例11: setMath

 /**
    * Sets the 'math' subelement of this InitialAssignment.
    *
    * The AST passed in @p math is copied.
    *
    * @param math an AST containing the mathematical expression to
    * be used as the formula for this InitialAssignment.
    *
    * @return integer value indicating success/failure of the
    * function.  The possible values
    * returned by this function are:
    * @li @link libsbmlcs.libsbml.LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS @endlink
    * @li @link libsbmlcs.libsbml.LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT @endlink
    */
 public int setMath(ASTNode math)
 {
     int ret = libsbmlPINVOKE.InitialAssignment_setMath(swigCPtr, ASTNode.getCPtr(math));
     return ret;
 }
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:19,代码来源:InitialAssignment.cs

示例12: test_ValidASTNode_setType

 public void test_ValidASTNode_setType()
 {
     ASTNode n = new ASTNode();
       int i = n.setType(libsbml.AST_REAL);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( n.getType() == libsbml.AST_REAL );
       i = n.setType(libsbml.AST_PLUS);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( n.getType() == libsbml.AST_PLUS );
       assertTrue( n.getCharacter() ==  '+'  );
       i = n.setType(libsbml.AST_FUNCTION_ARCCOSH);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( n.getType() == libsbml.AST_FUNCTION_ARCCOSH );
       i = n.setType(libsbml.AST_UNKNOWN);
       assertTrue( i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE );
       assertTrue( n.getType() == libsbml.AST_UNKNOWN );
       n = null;
 }
开发者ID:,项目名称:,代码行数:18,代码来源:

示例13: test_ValidASTNode_returnsBoolean

 public void test_ValidASTNode_returnsBoolean()
 {
     ASTNode node = new ASTNode ( libsbml.AST_LOGICAL_AND );
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_LOGICAL_NOT);
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_LOGICAL_OR);
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_LOGICAL_XOR);
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_FUNCTION_PIECEWISE);
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_RELATIONAL_EQ);
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_RELATIONAL_GEQ);
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_RELATIONAL_GT);
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_RELATIONAL_LEQ);
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_RELATIONAL_LT);
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_RELATIONAL_NEQ);
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_CONSTANT_TRUE);
       assertEquals( true, node.returnsBoolean() );
       node.setType(libsbml.AST_CONSTANT_FALSE);
       assertEquals( true, node.returnsBoolean() );
 }
开发者ID:,项目名称:,代码行数:29,代码来源:

示例14: createExampleEnzymaticReaction


//.........这里部分代码省略.........
        //---------------------------------------------------------------------------
        // Creates an ASTNode object which represents the following math of the
        // KineticLaw.
        //
        //      <math xmlns="http://www.w3.org/1998/Math/MathML">
        //        <apply>
        //          <times/>
        //          <ci> cytosol </ci>
        //          <apply>
        //            <minus/>
        //            <apply>
        //              <times/>
        //              <ci> kon </ci>
        //              <ci> E </ci>
        //              <ci> S </ci>
        //            </apply>
        //            <apply>
        //              <times/>
        //              <ci> koff </ci>
        //              <ci> ES </ci>
        //            </apply>
        //          </apply>
        //        </apply>
        //      </math>
        //
        //---------------------------------------------------------------------------

        //------------------------------------------
        //
        // create nodes representing the variables
        //
        //------------------------------------------

        ASTNode astCytosol = new ASTNode(libsbml.AST_NAME);
        astCytosol.setName("cytosol");

        ASTNode astKon = new ASTNode(libsbml.AST_NAME);
        astKon.setName("kon");

        ASTNode astKoff = new ASTNode(libsbml.AST_NAME);
        astKoff.setName("koff");

        ASTNode astE = new ASTNode(libsbml.AST_NAME);
        astE.setName("E");

        ASTNode astS = new ASTNode(libsbml.AST_NAME);
        astS.setName("S");

        ASTNode astES = new ASTNode(libsbml.AST_NAME);
        astES.setName("ES");

        //--------------------------------------------
        //
        // create node representing
        //            <apply>
        //              <times/>
        //              <ci> koff </ci>
        //              <ci> ES </ci>
        //            </apply>
        //
        //--------------------------------------------

        ASTNode astTimes1 = new ASTNode(libsbml.AST_TIMES);
        astTimes1.addChild(astKoff);
        astTimes1.addChild(astES);
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:66,代码来源:createExampleSBML.cs

示例15: test_element_neq

 public void test_element_neq()
 {
     string s = wrapMathML("<apply> <neq/> <notanumber/> <notanumber/> </apply>"
     );
       N = libsbml.readMathMLFromString(s);
       assertTrue( N != null );
       F = libsbml.formulaToString(N);
       assertTrue((  "neq(NaN, NaN)" == F ));
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:9,代码来源:TestReadMathML.cs


注:本文中的libsbmlcs.ASTNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。