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


C# SBMLDocument.getLevel方法代碼示例

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


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

示例1: test_SBMLConvertStrict_convertNonStrictSBO

 public void test_SBMLConvertStrict_convertNonStrictSBO()
 {
     SBMLDocument d = new  SBMLDocument(2,4);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId( "c");
       c.setConstant(false);
       (c).setSBOTerm(64);
       assertTrue( d.setLevelAndVersion(2,3,true) == false );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       assertTrue( d.setLevelAndVersion(2,2,true) == false );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       assertTrue( d.setLevelAndVersion(2,1,true) == true );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 1 );
       Compartment c1 = d.getModel().getCompartment(0);
       assertTrue( (c1).getSBOTerm() == -1 );
       assertTrue( d.setLevelAndVersion(1,2,true) == true );
       assertTrue( d.getLevel() == 1 );
       assertTrue( d.getVersion() == 2 );
       Compartment c2 = d.getModel().getCompartment(0);
       assertTrue( (c2).getSBOTerm() == -1 );
       d = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:26,代碼來源:TestSBMLConvertStrict.cs

示例2: test_SBMLDocument_createWith

 public void test_SBMLDocument_createWith()
 {
     SBMLDocument d = new  SBMLDocument(1,2);
       assertTrue( d.getTypeCode() == libsbml.SBML_DOCUMENT );
       assertTrue( d.getNotes() == null );
       assertTrue( d.getAnnotation() == null );
       assertTrue( d.getLevel() == 1 );
       assertTrue( d.getVersion() == 2 );
       assertTrue( d.getNumErrors() == 0 );
       d = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:11,代碼來源:TestSBMLDocument.cs

示例3: test_SBMLConvertStrict_convertL1ParamRule

 public void test_SBMLConvertStrict_convertL1ParamRule()
 {
     SBMLDocument d = new  SBMLDocument(1,2);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId( "c");
       Parameter p = m.createParameter();
       p.setId( "p");
       Parameter p1 = m.createParameter();
       p1.setId( "p1");
       ASTNode math = libsbml.parseFormula("p");
       Rule ar = m.createAssignmentRule();
       ar.setVariable( "p1");
       ar.setMath(math);
       ar.setUnits( "mole");
       assertTrue( d.setLevelAndVersion(2,1,true) == true );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 1 );
       Rule r1 = d.getModel().getRule(0);
       assertTrue( r1.getUnits() == "" );
       d = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:22,代碼來源:TestSBMLConvertStrict.cs

示例4: test_SBMLConvert_addModifiersToReaction

 public void test_SBMLConvert_addModifiersToReaction()
 {
     SBMLDocument d = new  SBMLDocument(1,2);
       Model m = d.createModel();
       Reaction r = m.createReaction();
       KineticLaw kl = r.createKineticLaw();
       kl.setFormula( "k1*S1*S2*S3*S4*S5");
       SimpleSpeciesReference ssr1;
       SimpleSpeciesReference ssr2;
       Species s1 = m.createSpecies();
       s1.setId( "S1" );
       Species s2 = m.createSpecies();
       s2.setId( "S2");
       Species s3 = m.createSpecies();
       s3.setId( "S3");
       Species s4 = m.createSpecies();
       s4.setId( "S4");
       Species s5 = m.createSpecies();
       s5.setId( "S5");
       SpeciesReference sr1 = r.createReactant();
       SpeciesReference sr2 = r.createReactant();
       SpeciesReference sr3 = r.createProduct();
       sr1.setSpecies( "S1");
       sr2.setSpecies( "S2");
       sr3.setSpecies( "S5");
       assertTrue( r.getNumModifiers() == 0 );
       assertTrue( d.setLevelAndVersion(2,1,false) == true );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 1 );
       assertTrue( m.getReaction(0).getNumModifiers() == 2 );
       ssr1 = m.getReaction(0).getModifier(0);
       ssr2 = m.getReaction(0).getModifier(1);
       assertTrue((  "S3" == ssr1.getSpecies() ));
       assertTrue((  "S4" == ssr2.getSpecies() ));
       d = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:36,代碼來源:TestSBMLConvert.cs

示例5: test_SBMLConvert_convertToL1_SBMLDocument

 public void test_SBMLConvert_convertToL1_SBMLDocument()
 {
     SBMLDocument d = new  SBMLDocument(2,1);
       assertTrue( d.setLevelAndVersion(1,2,false) == true );
       assertTrue( d.getLevel() == 1 );
       assertTrue( d.getVersion() == 2 );
       d = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:8,代碼來源:TestSBMLConvert.cs

示例6: test_SBMLConvert_convertToL2v4_DuplicateAnnotations_model

 public void test_SBMLConvert_convertToL2v4_DuplicateAnnotations_model()
 {
     SBMLDocument d = new  SBMLDocument(2,1);
       Model m = d.createModel();
       string annotation =  "<rdf/>\n<rdf/>";
       int i = (m).setAnnotation(annotation);
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 1 );
       assertTrue( (m).getAnnotation().getNumChildren() == 2 );
       assertTrue( d.setLevelAndVersion(2,4,true) == true );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       m = d.getModel();
       assertTrue( (m).getAnnotation().getNumChildren() == 1 );
       d = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:16,代碼來源:TestSBMLConvert.cs

示例7: test_SBMLDocument_copyConstructor

 public void test_SBMLDocument_copyConstructor()
 {
     SBMLDocument o1 = new SBMLDocument();
       o1.setLevelAndVersion(2,1,false);
       assertTrue( o1.getLevel() == 2 );
       assertTrue( o1.getVersion() == 1 );
       SBMLDocument o2 = new SBMLDocument(o1);
       assertTrue( o2.getLevel() == 2 );
       assertTrue( o2.getVersion() == 1 );
       o2 = null;
       o1 = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:12,代碼來源:TestCopyAndClone.cs

示例8: test_SBMLDocument_clone

 public void test_SBMLDocument_clone()
 {
     SBMLDocument o1 = new SBMLDocument();
       o1.setLevelAndVersion(1,1,false);
       Model m = new Model(1,1);
       m.setId("foo");
       o1.setModel(m);
       assertTrue( o1.getLevel() == 1 );
       assertTrue( o1.getVersion() == 1 );
       assertTrue( o1.getModel().getId() ==  "foo" );
       assertTrue( o1.getModel().getLevel() == 1 );
       assertTrue( o1.getModel().getVersion() == 1 );
       assertTrue( o1.getModel().getSBMLDocument() == o1 );
       SBMLDocument o2 = o1.clone();
       assertTrue( o2.getLevel() == 1 );
       assertTrue( o2.getVersion() == 1 );
       assertTrue( o2.getModel().getId() ==  "foo" );
       assertTrue( o2.getModel().getLevel() == 1 );
       assertTrue( o2.getModel().getVersion() == 1 );
       assertTrue( o2.getModel().getSBMLDocument() == o2 );
       o2 = null;
       o1 = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:23,代碼來源:TestCopyAndClone.cs

示例9: test_SBMLDocument_assignmentOperator

 public void test_SBMLDocument_assignmentOperator()
 {
     SBMLDocument o1 = new SBMLDocument();
       o1.setLevelAndVersion(2,1,false);
       assertTrue( o1.getLevel() == 2 );
       assertTrue( o1.getVersion() == 1 );
       SBMLDocument o2 = new SBMLDocument();
       o2 = o1;
       assertTrue( o2.getLevel() == 2 );
       assertTrue( o2.getVersion() == 1 );
       o2 = null;
       o1 = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:13,代碼來源:TestCopyAndClone.cs

示例10: test_SBMLConvertStrict_convertNonStrictUnits

 public void test_SBMLConvertStrict_convertNonStrictUnits()
 {
     SBMLDocument d = new  SBMLDocument(2,4);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId( "c");
       c.setConstant(false);
       Parameter p = m.createParameter();
       p.setId( "p");
       p.setUnits( "mole");
       ASTNode math = libsbml.parseFormula("p");
       Rule ar = m.createAssignmentRule();
       ar.setVariable( "c");
       ar.setMath(math);
       assertTrue( d.setLevelAndVersion(2,1,true) == false );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       assertTrue( d.setLevelAndVersion(2,2,true) == false );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       assertTrue( d.setLevelAndVersion(2,3,true) == false );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       assertTrue( d.setLevelAndVersion(1,2,true) == false );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       d = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:28,代碼來源:TestSBMLConvertStrict.cs

示例11: test_SBMLConvertStrict_convertToL1

 public void test_SBMLConvertStrict_convertToL1()
 {
     SBMLDocument d = new  SBMLDocument(2,4);
       Model m = d.createModel();
       (m).setMetaId( "_m");
       Compartment c = m.createCompartment();
       c.setId( "c");
       (c).setSBOTerm(240);
       Species s = m.createSpecies();
       s.setId( "s");
       s.setCompartment( "c");
       s.setHasOnlySubstanceUnits(true);
       assertTrue( d.setLevelAndVersion(1,2,true) == true );
       assertTrue( d.getLevel() == 1 );
       assertTrue( d.getVersion() == 2 );
       Model m1 = d.getModel();
       assertTrue( (m1).getMetaId() == "" );
       Compartment c1 = m1.getCompartment(0);
       assertTrue( (c1).getSBOTerm() == -1 );
       Species s1 = m1.getSpecies(0);
       assertTrue( s1.getHasOnlySubstanceUnits() == false );
       d = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:23,代碼來源:TestSBMLConvertStrict.cs

示例12: test_ReadSBML_SBML

 public void test_ReadSBML_SBML()
 {
     string s = wrapXML("<sbml level='1' version='1'> </sbml>");
       D = libsbml.readSBMLFromString(s);
       assertTrue( D.getLevel() == 1 );
       assertTrue( D.getVersion() == 1 );
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:7,代碼來源:TestReadSBML.cs


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