本文整理汇总了C#中libsbmlcs.SBMLDocument.setLevelAndVersion方法的典型用法代码示例。如果您正苦于以下问题:C# SBMLDocument.setLevelAndVersion方法的具体用法?C# SBMLDocument.setLevelAndVersion怎么用?C# SBMLDocument.setLevelAndVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbmlcs.SBMLDocument
的用法示例。
在下文中一共展示了SBMLDocument.setLevelAndVersion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: test_SBMLDocument_setLevelAndVersion
public void test_SBMLDocument_setLevelAndVersion()
{
SBMLDocument d = new SBMLDocument(2,2);
Model m1 = new Model(2,2);
d.setModel(m1);
assertTrue( d.setLevelAndVersion(2,3,false) == true );
assertTrue( d.setLevelAndVersion(2,1,false) == true );
assertTrue( d.setLevelAndVersion(1,2,false) == true );
assertTrue( d.setLevelAndVersion(1,1,false) == false );
d = null;
}
示例3: test_SBMLDocument_setLevelAndVersion_Error
public void test_SBMLDocument_setLevelAndVersion_Error()
{
SBMLDocument d = new SBMLDocument();
d.setLevelAndVersion(2,1,true);
Model m1 = new Model(2,1);
Unit u = new Unit(2,1);
u.setKind(libsbml.UnitKind_forName("mole"));
u.setOffset(3.2);
UnitDefinition ud = new UnitDefinition(2,1);
ud.setId( "ud");
ud.addUnit(u);
m1.addUnitDefinition(ud);
d.setModel(m1);
assertTrue( d.setLevelAndVersion(2,2,true) == false );
assertTrue( d.setLevelAndVersion(2,3,true) == false );
assertTrue( d.setLevelAndVersion(1,2,true) == false );
assertTrue( d.setLevelAndVersion(1,1,true) == false );
d = null;
}
示例4: 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;
}
示例5: 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;
}
示例6: test_SBMLConvert_convertToL3_reaction
public void test_SBMLConvert_convertToL3_reaction()
{
SBMLDocument d = new SBMLDocument(2,2);
Model m = d.createModel();
string sid = "C";
Reaction r = m.createReaction();
r.setId(sid);
assertTrue( d.setLevelAndVersion(3,1,false) == true );
Reaction r1 = m.getReaction(0);
assertTrue( r1.hasRequiredAttributes() == true );
d = null;
}
示例7: test_SBMLConvert_convertToL3_species
public void test_SBMLConvert_convertToL3_species()
{
SBMLDocument d = new SBMLDocument(2,2);
Model m = d.createModel();
string sid = "C";
Species s = m.createSpecies();
Species s1;
s.setId(sid);
s.setCompartment( "comp");
assertTrue( d.setLevelAndVersion(3,1,false) == true );
s1 = m.getSpecies(0);
assertTrue( s1.hasRequiredAttributes() == true );
d = null;
}
示例8: 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");
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;
}
示例9: test_SBMLConvert_convertFromL3_modelUnits
public void test_SBMLConvert_convertFromL3_modelUnits()
{
UnitDefinition ud;
SBMLDocument d = new SBMLDocument(3,1);
Model m = d.createModel();
m.setVolumeUnits( "litre");
assertTrue( m.getNumUnitDefinitions() == 0 );
assertTrue( d.setLevelAndVersion(1,2,false) == true );
m = d.getModel();
assertTrue( m.getNumUnitDefinitions() == 1 );
ud = m.getUnitDefinition(0);
assertTrue(( "volume" == ud.getId() ));
assertTrue( ud.getNumUnits() == 1 );
assertTrue( ud.getUnit(0).getKind() == libsbml.UNIT_KIND_LITRE );
}
示例10: test_SBMLConvert_convertToL3_unit
public void test_SBMLConvert_convertToL3_unit()
{
SBMLDocument d = new SBMLDocument(2,2);
Model m = d.createModel();
string sid = "C";
UnitDefinition ud = m.createUnitDefinition();
ud.setId(sid);
Unit u = ud.createUnit();
u.setKind(libsbml.UNIT_KIND_MOLE);
assertTrue( d.setLevelAndVersion(3,1,false) == true );
Unit u1 = m.getUnitDefinition(0).getUnit(0);
assertTrue( u1.hasRequiredAttributes() == true );
d = null;
}
示例11: test_SBMLConvert_convertFromL3
public void test_SBMLConvert_convertFromL3()
{
SBMLDocument d = new SBMLDocument(3,1);
Model m = d.createModel();
string sid = "C";
Compartment c = m.createCompartment();
c.setId(sid);
c.setSize(1.2);
c.setConstant(true);
c.setSpatialDimensions(3.4);
assertTrue( d.setLevelAndVersion(1,1,true) == false );
assertTrue( d.setLevelAndVersion(1,2,true) == false );
assertTrue( d.setLevelAndVersion(2,1,true) == false );
assertTrue( d.setLevelAndVersion(2,2,true) == false );
assertTrue( d.setLevelAndVersion(2,3,true) == false );
assertTrue( d.setLevelAndVersion(2,4,true) == false );
assertTrue( d.setLevelAndVersion(3,1,true) == true );
}
示例12: test_SBMLConvert_convertToL2_SBMLDocument
public void test_SBMLConvert_convertToL2_SBMLDocument()
{
SBMLDocument d = new SBMLDocument(1,2);
assertTrue( d.setLevelAndVersion(2,1,false) == true );
assertTrue( d.getLevel() == 2 );
assertTrue( d.getVersion() == 1 );
assertTrue( d.setLevelAndVersion(2,2,false) == true );
assertTrue( d.getLevel() == 2 );
assertTrue( d.getVersion() == 2 );
assertTrue( d.setLevelAndVersion(2,3,false) == true );
assertTrue( d.getLevel() == 2 );
assertTrue( d.getVersion() == 3 );
d = null;
}
示例13: test_SBMLConvert_convertToL3_compartment
public void test_SBMLConvert_convertToL3_compartment()
{
SBMLDocument d = new SBMLDocument(2,2);
Model m = d.createModel();
string sid = "C";
Compartment c = m.createCompartment();
Compartment c1;
c.setId(sid);
assertTrue( d.setLevelAndVersion(3,1,false) == true );
c1 = m.getCompartment(0);
assertTrue( c1.hasRequiredAttributes() == true );
d = null;
}
示例14: test_SBMLConvert_convertToL1_Species_Concentration
public void test_SBMLConvert_convertToL1_Species_Concentration()
{
SBMLDocument d = new SBMLDocument(2,1);
Model m = d.createModel();
string sid = "C";
Compartment c = new Compartment(2,1);
Species s = new Species(2,1);
c.setId(sid);
c.setSize(1.2);
m.addCompartment(c);
s.setId( "s" );
s.setCompartment(sid);
s.setInitialConcentration(2.34);
m.addSpecies(s);
assertTrue( d.setLevelAndVersion(1,2,true) == true );
Species s1 = m.getSpecies(0);
assertTrue( s1 != null );
assertTrue(( "C" == s1.getCompartment() ));
assertTrue( m.getCompartment( "C").getSize() == 1.2 );
assertTrue( s1.getInitialConcentration() == 2.34 );
assertTrue( s1.isSetInitialConcentration() == true );
d = null;
}
示例15: 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;
}