本文整理汇总了C#中libsbmlcs.Reaction类的典型用法代码示例。如果您正苦于以下问题:C# Reaction类的具体用法?C# Reaction怎么用?C# Reaction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Reaction类属于libsbmlcs命名空间,在下文中一共展示了Reaction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_KineticLaw_getParameterById
public void test_KineticLaw_getParameterById()
{
Parameter k1 = new Parameter(2,4);
Parameter k2 = new Parameter(2,4);
k1.setId( "k1");
k2.setId( "k2");
k1.setValue(3.14);
k2.setValue(2.72);
M.addParameter(k1);
M.addParameter(k2);
Reaction r1 = new Reaction(2,4);
r1.setId( "reaction_1" );
KineticLaw kl = new KineticLaw(2,4);
kl.setFormula( "k1 * X0");
Parameter k3 = new Parameter(2,4);
Parameter k4 = new Parameter(2,4);
k3.setId( "k1");
k4.setId( "k2");
k3.setValue(2.72);
k4.setValue(3.14);
kl.addParameter(k3);
kl.addParameter(k4);
r1.setKineticLaw(kl);
M.addReaction(r1);
KineticLaw kl1 = M.getReaction(0).getKineticLaw();
assertNotEquals(kl1.getParameter( "k1" ),k3);
assertNotEquals(kl1.getParameter( "k1" ),k1);
assertNotEquals(kl1.getParameter( "k2" ),k4);
assertEquals(kl1.getParameter( "k3" ),null);
}
示例2: setUp
public void setUp()
{
R = new Reaction(2,4);
if (R == null);
{
}
}
示例3: test_Reaction_addProduct2
public void test_Reaction_addProduct2()
{
Reaction m = new Reaction(2,2);
SpeciesReference p = new SpeciesReference(2,1);
p.setSpecies( "k");
int i = m.addProduct(p);
assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH );
assertTrue( m.getNumProducts() == 0 );
p = null;
m = null;
}
示例4: test_Reaction_addProduct1
public void test_Reaction_addProduct1()
{
Reaction m = new Reaction(2,2);
SpeciesReference p = new SpeciesReference(2,2);
SpeciesReference p1 = new SpeciesReference(2,2);
p1.setSpecies( "k");
p1.setId( "k1");
int i = m.addProduct(p);
assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
p.setSpecies( "k");
p.setId( "k1");
i = m.addProduct(p);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( m.getNumProducts() == 1 );
i = m.addProduct(p1);
assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID );
assertTrue( m.getNumProducts() == 1 );
p = null;
p1 = null;
m = null;
}
示例5: test_Reaction_addReactant3
public void test_Reaction_addReactant3()
{
Reaction m = new Reaction(2,2);
SpeciesReference p = new SpeciesReference(1,2);
p.setSpecies( "k");
int i = m.addReactant(p);
assertTrue( i == libsbml.LIBSBML_LEVEL_MISMATCH );
assertTrue( m.getNumReactants() == 0 );
p = null;
m = null;
}
示例6: test_SpeciesReference_Reactant_parent_create
public void test_SpeciesReference_Reactant_parent_create()
{
Reaction r = new Reaction(2,4);
SpeciesReference sr = r.createReactant();
ListOf lo = r.getListOfReactants();
assertTrue( lo == r.getReactant(0).getParentSBMLObject() );
assertTrue( lo == sr.getParentSBMLObject() );
assertTrue( r == lo.getParentSBMLObject() );
}
示例7: test_KineticLaw_ancestor_create
public void test_KineticLaw_ancestor_create()
{
Reaction r = new Reaction(2,4);
KineticLaw kl = r.createKineticLaw();
assertTrue( kl.getAncestorOfType(libsbml.SBML_REACTION) == r );
assertTrue( kl.getAncestorOfType(libsbml.SBML_DELAY) == null );
assertTrue( kl.getAncestorOfType(libsbml.SBML_MODEL) == null );
assertTrue( kl.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
KineticLaw obj = r.getKineticLaw();
assertTrue( obj.getAncestorOfType(libsbml.SBML_REACTION) == r );
assertTrue( obj.getAncestorOfType(libsbml.SBML_MODEL) == null );
assertTrue( obj.getAncestorOfType(libsbml.SBML_DELAY) == null );
assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
r = null;
}
示例8: test_SpeciesReference_Modifier_ancestor_add
public void test_SpeciesReference_Modifier_ancestor_add()
{
ModifierSpeciesReference sr = new ModifierSpeciesReference(2,4);
sr.setSpecies("s");
Reaction r = new Reaction(2,4);
r.addModifier(sr);
sr = null;
ListOf lo = r.getListOfModifiers();
ModifierSpeciesReference obj = r.getModifier(0);
assertTrue( obj.getAncestorOfType(libsbml.SBML_REACTION) == r );
assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
assertTrue( obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
}
示例9: test_Reaction_createWithNS
public void test_Reaction_createWithNS()
{
XMLNamespaces xmlns = new XMLNamespaces();
xmlns.add( "http://www.sbml.org", "testsbml");
SBMLNamespaces sbmlns = new SBMLNamespaces(2,1);
sbmlns.addNamespaces(xmlns);
Reaction object1 = new Reaction(sbmlns);
assertTrue( object1.getTypeCode() == libsbml.SBML_REACTION );
assertTrue( object1.getMetaId() == "" );
assertTrue( object1.getNotes() == null );
assertTrue( object1.getAnnotation() == null );
assertTrue( object1.getLevel() == 2 );
assertTrue( object1.getVersion() == 1 );
assertTrue( object1.getNamespaces() != null );
assertTrue( object1.getNamespaces().getLength() == 2 );
object1 = null;
}
示例10: test_Reaction_setName3
public void test_Reaction_setName3()
{
Reaction p = new Reaction(2,2);
int i = p.setName("");
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertEquals( false, p.isSetName() );
p = null;
}
示例11: test_Reaction_createReactant
public void test_Reaction_createReactant()
{
Reaction m = new Reaction(2,2);
SpeciesReference p = m.createReactant();
assertTrue( m.getNumReactants() == 1 );
assertTrue( (p).getLevel() == 2 );
assertTrue( (p).getVersion() == 2 );
m = null;
}
示例12: test_KineticLaw_parent_create
public void test_KineticLaw_parent_create()
{
Reaction r = new Reaction(2,4);
KineticLaw kl = r.createKineticLaw();
assertTrue( r == kl.getParentSBMLObject() );
r = null;
}
示例13: test_KineticLaw_parent_add
public void test_KineticLaw_parent_add()
{
KineticLaw kl = new KineticLaw(2,4);
Reaction r = new Reaction(2,4);
r.setKineticLaw(kl);
assertTrue( r == r.getKineticLaw().getParentSBMLObject() );
r = null;
}
示例14: test_L3_Reaction_createWithNS
public void test_L3_Reaction_createWithNS()
{
XMLNamespaces xmlns = new XMLNamespaces();
xmlns.add( "http://www.sbml.org", "testsbml");
SBMLNamespaces sbmlns = new SBMLNamespaces(3,1);
sbmlns.addNamespaces(xmlns);
Reaction r = new Reaction(sbmlns);
assertTrue( r.getTypeCode() == libsbml.SBML_REACTION );
assertTrue( r.getMetaId() == "" );
assertTrue( r.getNotes() == null );
assertTrue( r.getAnnotation() == null );
assertTrue( r.getLevel() == 3 );
assertTrue( r.getVersion() == 1 );
assertTrue( r.getNamespaces() != null );
assertTrue( r.getNamespaces().getLength() == 2 );
assertTrue( r.getId() == "" );
assertTrue( r.getName() == "" );
assertTrue( r.getCompartment() == "" );
assertTrue( r.getFast() == false );
assertTrue( r.getReversible() == true );
assertEquals( false, r.isSetId() );
assertEquals( false, r.isSetName() );
assertEquals( false, r.isSetCompartment() );
assertEquals( false, r.isSetFast() );
assertEquals( false, r.isSetReversible() );
r = null;
}
示例15: test_L3_Reaction_hasRequiredAttributes
public void test_L3_Reaction_hasRequiredAttributes()
{
Reaction r = new Reaction(3,1);
assertEquals( false, r.hasRequiredAttributes() );
r.setId( "id");
assertEquals( false, r.hasRequiredAttributes() );
r.setFast(false);
assertEquals( false, r.hasRequiredAttributes() );
r.setReversible(false);
assertEquals( true, r.hasRequiredAttributes() );
r = null;
}