當前位置: 首頁>>代碼示例>>C#>>正文


C# ASTNode.setName方法代碼示例

本文整理匯總了C#中libsbmlcs.ASTNode.setName方法的典型用法代碼示例。如果您正苦於以下問題:C# ASTNode.setName方法的具體用法?C# ASTNode.setName怎麽用?C# ASTNode.setName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在libsbmlcs.ASTNode的用法示例。


在下文中一共展示了ASTNode.setName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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

示例2: test_Rule_setMath2

 public void test_Rule_setMath2()
 {
     ASTNode math = new  ASTNode(libsbml.AST_DIVIDE);
       ASTNode a = new  ASTNode();
       a.setName( "a");
       math.addChild(a);
       int i = R.setMath(math);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       assertEquals( false, R.isSetMath() );
       math = null;
 }
開發者ID:0u812,項目名稱:roadrunner-backup,代碼行數:11,代碼來源:TestRule_newSetters.cs

示例3: test_MathMLFormatter_csymbol_time

 public void test_MathMLFormatter_csymbol_time()
 {
     string expected = wrapMathML("  <csymbol encoding=\"text\" " + "definitionURL=\"http://www.sbml.org/sbml/symbols/time\"> t </csymbol>\n");
       N = new ASTNode(libsbml.AST_NAME_TIME);
       N.setName("t");
       S = libsbml.writeMathMLToString(N);
       assertEquals( true, equals(expected,S) );
 }
開發者ID:alexholehouse,項目名稱:SBMLIntegrator,代碼行數:8,代碼來源:TestWriteMathML.cs

示例4: test_ASTNode_avogadro_bug

 public void test_ASTNode_avogadro_bug()
 {
     double val;
       ASTNode n = new  ASTNode();
       n.setName( "NA");
       n.setType(libsbml.AST_NAME_AVOGADRO);
       assertTrue((  "NA" == n.getName() ));
       val = n.getReal();
       assertTrue( val == 6.02214179e23 );
       assertTrue( n.isConstant() == true );
       n = null;
 }
開發者ID:TotteKarlsson,項目名稱:roadrunner,代碼行數:12,代碼來源:TestASTNode.cs

示例5: test_ASTNode_replaceChild

 public void test_ASTNode_replaceChild()
 {
     ASTNode node = new  ASTNode();
       ASTNode c1 = new  ASTNode();
       ASTNode c2 = new  ASTNode();
       ASTNode c3 = new  ASTNode();
       ASTNode newc = new  ASTNode();
       int i = 0;
       node.setType(libsbml.AST_LOGICAL_AND);
       c1.setName( "a");
       c2.setName( "b");
       c3.setName( "c");
       node.addChild(c1);
       node.addChild(c2);
       node.addChild(c3);
       assertTrue( node.getNumChildren() == 3 );
       assertTrue((  "and(a, b, c)" == libsbml.formulaToString(node) ));
       newc.setName( "d");
       i = node.replaceChild(0,newc);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getNumChildren() == 3 );
       assertTrue((  "and(d, b, c)" == libsbml.formulaToString(node) ));
       i = node.replaceChild(3,newc);
       assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
       assertTrue( node.getNumChildren() == 3 );
       assertTrue((  "and(d, b, c)" == libsbml.formulaToString(node) ));
       i = node.replaceChild(1,c1);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getNumChildren() == 3 );
       assertTrue((  "and(d, a, c)" == libsbml.formulaToString(node) ));
       node = null;
 }
開發者ID:TotteKarlsson,項目名稱:roadrunner,代碼行數:32,代碼來源:TestASTNode.cs

示例6: test_ASTNode_getName

 public void test_ASTNode_getName()
 {
     ASTNode n = new  ASTNode();
       n.setName( "foo");
       assertTrue((  "foo" == n.getName() ));
       n.setType(libsbml.AST_NAME_TIME);
       assertTrue((  "foo" == n.getName() ));
       n.setName(null);
       assertTrue( n.getName() == null );
       n.setType(libsbml.AST_CONSTANT_E);
       assertTrue((  "exponentiale" == n.getName() ));
       n.setType(libsbml.AST_CONSTANT_FALSE);
       assertTrue((  "false" == n.getName() ));
       n.setType(libsbml.AST_CONSTANT_PI);
       assertTrue((  "pi" == n.getName() ));
       n.setType(libsbml.AST_CONSTANT_TRUE);
       assertTrue((  "true" == n.getName() ));
       n.setType(libsbml.AST_LAMBDA);
       assertTrue((  "lambda" == n.getName() ));
       n.setType(libsbml.AST_FUNCTION);
       n.setName( "f");
       assertTrue((  "f" == n.getName() ));
       n.setType(libsbml.AST_FUNCTION_DELAY);
       assertTrue((  "f" == n.getName() ));
       n.setName(null);
       assertTrue((  "delay" == n.getName() ));
       n.setType(libsbml.AST_FUNCTION);
       assertTrue( n.getName() == null );
       n.setType(libsbml.AST_FUNCTION_ABS);
       assertTrue((  "abs" == n.getName() ));
       n.setType(libsbml.AST_FUNCTION_ARCCOS);
       assertTrue((  "arccos" == n.getName() ));
       n.setType(libsbml.AST_FUNCTION_TAN);
       assertTrue((  "tan" == n.getName() ));
       n.setType(libsbml.AST_FUNCTION_TANH);
       assertTrue((  "tanh" == n.getName() ));
       n.setType(libsbml.AST_LOGICAL_AND);
       assertTrue((  "and" == n.getName() ));
       n.setType(libsbml.AST_LOGICAL_NOT);
       assertTrue((  "not" == n.getName() ));
       n.setType(libsbml.AST_LOGICAL_OR);
       assertTrue((  "or" == n.getName() ));
       n.setType(libsbml.AST_LOGICAL_XOR);
       assertTrue((  "xor" == n.getName() ));
       n.setType(libsbml.AST_RELATIONAL_EQ);
       assertTrue((  "eq" == n.getName() ));
       n.setType(libsbml.AST_RELATIONAL_GEQ);
       assertTrue((  "geq" == n.getName() ));
       n.setType(libsbml.AST_RELATIONAL_LT);
       assertTrue((  "lt" == n.getName() ));
       n.setType(libsbml.AST_RELATIONAL_NEQ);
       assertTrue((  "neq" == n.getName() ));
       n = null;
 }
開發者ID:TotteKarlsson,項目名稱:roadrunner,代碼行數:54,代碼來源:TestASTNode.cs

示例7: test_ASTNode_deepCopy_4

 public void test_ASTNode_deepCopy_4()
 {
     ASTNode node = new  ASTNode(libsbml.AST_FUNCTION_ABS);
       ASTNode copy;
       node.setName( "ABS");
       assertTrue( node.getType() == libsbml.AST_FUNCTION_ABS );
       assertTrue((  "ABS" == node.getName() ));
       assertTrue( node.getNumChildren() == 0 );
       copy = node.deepCopy();
       assertTrue( copy != node );
       assertTrue( copy.getType() == libsbml.AST_FUNCTION_ABS );
       assertTrue((  "ABS" == copy.getName() ));
       assertTrue( copy.getNumChildren() == 0 );
       node = null;
       copy = null;
 }
開發者ID:TotteKarlsson,項目名稱:roadrunner,代碼行數:16,代碼來源:TestASTNode.cs

示例8: test_ASTNode_setInteger

 public void test_ASTNode_setInteger()
 {
     ASTNode node = new  ASTNode();
       node.setName( "foo");
       assertTrue( node.getType() == libsbml.AST_NAME );
       assertTrue((  "foo" == node.getName() ));
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setValue(3.2);
       assertTrue( node.getType() == libsbml.AST_REAL );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getName() == null );
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getReal() == 3.2 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setValue(321);
       assertTrue( node.getType() == libsbml.AST_INTEGER );
       assertTrue( node.getInteger() == 321 );
       assertTrue( node.getName() == null );
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node = null;
 }
開發者ID:TotteKarlsson,項目名稱:roadrunner,代碼行數:29,代碼來源:TestASTNode.cs

示例9: test_KineticLaw_setMath1

 public void test_KineticLaw_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 = kl.setMath(math);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( true, kl.isSetMath() );
       math1 = kl.getMath();
       assertTrue( math1 != null );
       formula = libsbml.formulaToString(math1);
       assertTrue( formula != null );
       assertTrue((  "a * b" == formula ));
       math = null;
 }
開發者ID:alexholehouse,項目名稱:SBMLIntegrator,代碼行數:21,代碼來源:TestKineticLaw_newSetters.cs

示例10: test_KineticLaw_setMath2

 public void test_KineticLaw_setMath2()
 {
     ASTNode math = new  ASTNode(libsbml.AST_TIMES);
       ASTNode a = new  ASTNode();
       a.setName( "a");
       math.addChild(a);
       int i = kl.setMath(math);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       assertEquals( false, kl.isSetMath() );
       math = null;
 }
開發者ID:alexholehouse,項目名稱:SBMLIntegrator,代碼行數:11,代碼來源:TestKineticLaw_newSetters.cs

示例11: Main

    public static void Main(string[] args)
    {
        ArraysPkgNamespaces arraysNs = new ArraysPkgNamespaces();
        SBMLDocument doc = new SBMLDocument(arraysNs);
        doc.setPackageRequired("arrays", true);
        Model model = doc.createModel();

        // create compartment
        Compartment comp = model.createCompartment();
        comp.setMetaId("dd");
        comp.setId("s");
        comp.setConstant(true);

        // set dimensions
        ArraysSBasePlugin compPlugin = (ArraysSBasePlugin) comp.getPlugin("arrays");
        Dimension dim = compPlugin.createDimension();
        dim.setId("i");
        dim.setSize("n");

        // create species
        Species species = model.createSpecies();
        species.setId("A");
        species.setCompartment("s");
        species.setHasOnlySubstanceUnits(false);
        species.setBoundaryCondition(false);
        species.setConstant(false);

        ArraysSBasePlugin splugin = (ArraysSBasePlugin) species.getPlugin("arrays");
        dim = splugin.createDimension();
        dim.setId("i");
        dim.setSize("n");

        species = model.createSpecies();
        species.setId("B");
        species.setCompartment("s");
        species.setHasOnlySubstanceUnits(false);
        species.setBoundaryCondition(false);
        species.setConstant(false);

        splugin = (ArraysSBasePlugin) species.getPlugin("arrays");
        dim = splugin.createDimension();
        dim.setId("i");
        dim.setSize("n");

        species = model.createSpecies();
        species.setId("C");
        species.setCompartment("s");
        species.setHasOnlySubstanceUnits(false);
        species.setBoundaryCondition(false);
        species.setConstant(false);

        splugin = (ArraysSBasePlugin) species.getPlugin("arrays");
        dim = splugin.createDimension();
        dim.setId("i");
        dim.setSize("n");

        // create parameter
        Parameter param = model.createParameter();
        param.setId("n");
        param.setValue(100);
        param.setConstant(true);

        // create reaction
        Reaction reaction = model.createReaction();
        reaction.setId("reaction1");
        reaction.setReversible(false);
        reaction.setFast(false);

        ArraysSBasePlugin reactionPlugin = (ArraysSBasePlugin) reaction.getPlugin("arrays");
        dim = reactionPlugin.createDimension();
        dim.setId("i");
        dim.setSize("n");

        SpeciesReference speciesRef = reaction.createReactant();
        speciesRef.setSpecies("A");
        speciesRef.setConstant(false);
        ArraysSBasePlugin refPlugin = (ArraysSBasePlugin) speciesRef.getPlugin("arrays");
        Index index = refPlugin.createIndex();
        ASTNode ast = new ASTNode(libsbml.AST_LINEAR_ALGEBRA_SELECTOR);
        ASTNode ci = new ASTNode(libsbml.AST_NAME);
        ci.setName("A");
        ast.addChild(ci);
        ci = new ASTNode(libsbml.AST_NAME);
        ci.setName("i");
        ast.addChild(ci);
        index.setMath(ast);

        speciesRef = reaction.createProduct();
        speciesRef.setSpecies("C");
        speciesRef.setConstant(false);
        refPlugin = (ArraysSBasePlugin) speciesRef.getPlugin("arrays");
        index = refPlugin.createIndex();
        ast = new ASTNode(libsbml.AST_LINEAR_ALGEBRA_SELECTOR);
        ci = new ASTNode(libsbml.AST_NAME);
        ci.setName("C");
        ast.addChild(ci);
        ci = new ASTNode(libsbml.AST_NAME);
        ci.setName("i");
        ast.addChild(ci);
        index.setMath(ast);
//.........這裏部分代碼省略.........
開發者ID:sys-bio,項目名稱:libroadrunner-deps,代碼行數:101,代碼來源:CreateArrays1.cs

示例12: test_SpeciesReference_setStoichiometryMath5

 public void test_SpeciesReference_setStoichiometryMath5()
 {
     SpeciesReference sr1 = new  SpeciesReference(1,2);
       StoichiometryMath sm = new  StoichiometryMath(2,4);
       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);
       sm.setMath(math);
       int i = sr1.setStoichiometryMath(sm);
       assertTrue( i == libsbml.LIBSBML_UNEXPECTED_ATTRIBUTE );
       assertEquals( false, sr1.isSetStoichiometryMath() );
       sm = null;
       sr1 = null;
 }
開發者ID:0u812,項目名稱:roadrunner-backup,代碼行數:18,代碼來源:TestSpeciesReference_newSetters.cs

示例13: test_SpeciesReference_setStoichiometryMath2

 public void test_SpeciesReference_setStoichiometryMath2()
 {
     StoichiometryMath sm = new  StoichiometryMath(2,4);
       ASTNode math = new  ASTNode(libsbml.AST_TIMES);
       ASTNode a = new  ASTNode();
       a.setName( "a");
       math.addChild(a);
       sm.setMath(math);
       int i = sr.setStoichiometryMath(sm);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( true, sr.isSetStoichiometryMath() );
       sm = null;
 }
開發者ID:0u812,項目名稱:roadrunner-backup,代碼行數:13,代碼來源:TestSpeciesReference_newSetters.cs

示例14: test_ASTNode_canonicalizeLogical

 public void test_ASTNode_canonicalizeLogical()
 {
     ASTNode n = new  ASTNode(libsbml.AST_FUNCTION);
       n.setName( "and");
       assertTrue( n.getType() == libsbml.AST_FUNCTION );
       n.canonicalize();
       assertTrue( n.getType() == libsbml.AST_LOGICAL_AND );
       n.setType(libsbml.AST_FUNCTION);
       n.setName( "not");
       assertTrue( n.getType() == libsbml.AST_FUNCTION );
       n.canonicalize();
       assertTrue( n.getType() == libsbml.AST_LOGICAL_NOT );
       n.setType(libsbml.AST_FUNCTION);
       n.setName( "or");
       assertTrue( n.getType() == libsbml.AST_FUNCTION );
       n.canonicalize();
       assertTrue( n.getType() == libsbml.AST_LOGICAL_OR );
       n.setType(libsbml.AST_FUNCTION);
       n.setName( "xor");
       assertTrue( n.getType() == libsbml.AST_FUNCTION );
       n.canonicalize();
       assertTrue( n.getType() == libsbml.AST_LOGICAL_XOR );
       n.setType(libsbml.AST_FUNCTION);
       n = null;
 }
開發者ID:TotteKarlsson,項目名稱:roadrunner,代碼行數:25,代碼來源:TestASTNode.cs

示例15: test_ASTNode_setName

 public void test_ASTNode_setName()
 {
     string name =  "foo";
       ASTNode node = new  ASTNode();
       assertTrue( node.getType() == libsbml.AST_UNKNOWN );
       node.setName(name);
       assertTrue( node.getType() == libsbml.AST_NAME );
       assertTrue(( name == node.getName() ));
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       if (node.getName() == name);
       {
       }
       node.setName(null);
       assertTrue( node.getType() == libsbml.AST_NAME );
       if (node.getName() != null);
       {
       }
       node.setType(libsbml.AST_FUNCTION_COS);
       assertTrue( node.getType() == libsbml.AST_FUNCTION_COS );
       assertTrue((  "cos" == node.getName() ));
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setType(libsbml.AST_PLUS);
       node.setName(name);
       assertTrue( node.getType() == libsbml.AST_NAME );
       assertTrue(( name == node.getName() ));
       assertTrue( node.getCharacter() == '+' );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node = null;
 }
開發者ID:TotteKarlsson,項目名稱:roadrunner,代碼行數:40,代碼來源:TestASTNode.cs


注:本文中的libsbmlcs.ASTNode.setName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。