本文整理汇总了C#中libsbmlcs.Reaction.getPlugin方法的典型用法代码示例。如果您正苦于以下问题:C# Reaction.getPlugin方法的具体用法?C# Reaction.getPlugin怎么用?C# Reaction.getPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbmlcs.Reaction
的用法示例。
在下文中一共展示了Reaction.getPlugin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
private static int Main(string[] args)
{
var retval = 0;
var sbmlns = new SBMLNamespaces(3, 1, "comp", 1);
// create the document
var document = new SBMLDocument(sbmlns);
var compdoc = (CompSBMLDocumentPlugin)(document.getPlugin("comp"));
compdoc.setRequired(true);
var mod1 = compdoc.createModelDefinition();
mod1.setId("enzyme");
mod1.setName("enzyme");
var comp = mod1.createCompartment();
comp.setSpatialDimensions(3);
comp.setConstant(true);
comp.setId("comp");
comp.setSize(1L);
var spec = new Species(sbmlns);
//We have to construct it this way because we get the comp plugin from it later.
spec.setCompartment("comp");
spec.setHasOnlySubstanceUnits(false);
spec.setConstant(false);
spec.setBoundaryCondition(false);
spec.setId("S");
mod1.addSpecies(spec);
spec.setId("E");
mod1.addSpecies(spec);
spec.setId("D");
mod1.addSpecies(spec);
spec.setId("ES");
mod1.addSpecies(spec);
var rxn = new Reaction(sbmlns);
rxn.setReversible(true);
rxn.setFast(false);
var rxn2 = new Reaction(sbmlns);
rxn2.setReversible(true);
rxn2.setFast(false);
rxn.setId("J0");
rxn2.setId("J1");
var sr = new SpeciesReference(3, 1);
sr.setConstant(true);
sr.setStoichiometry(1);
sr.setSpecies("S");
rxn.addReactant(sr);
sr.setSpecies("E");
rxn.addReactant(sr);
rxn2.addProduct(sr);
sr.setSpecies("ES");
rxn.addProduct(sr);
rxn2.addReactant(sr);
sr.setSpecies("D");
rxn2.addProduct(sr);
mod1.addReaction(rxn);
mod1.addReaction(rxn2);
var mod1plug = (CompModelPlugin)(mod1.getPlugin("comp"));
var m1port = new Port();
m1port.setIdRef("comp");
m1port.setId("comp_port");
mod1plug.addPort(m1port);
m1port.setIdRef("S");
m1port.setId("S_port");
mod1plug.addPort(m1port);
m1port.setIdRef("E");
m1port.setId("E_port");
mod1plug.addPort(m1port);
m1port.setIdRef("D");
m1port.setId("D_port");
mod1plug.addPort(m1port);
m1port.setIdRef("ES");
m1port.setId("ES_port");
mod1plug.addPort(m1port);
m1port.setIdRef("J0");
m1port.setId("J0_port");
mod1plug.addPort(m1port);
m1port.setIdRef("J1");
m1port.setId("J1_port");
mod1plug.addPort(m1port);
//Define the 'simple' model
var mod2 = compdoc.createModelDefinition();
mod2.setId("simple");
var comp2 = mod2.createCompartment();
comp2.setSpatialDimensions(3);
comp2.setConstant(true);
comp2.setId("comp");
comp2.setSize(1L);
spec.setCompartment("comp");
spec.setHasOnlySubstanceUnits(false);
spec.setConstant(false);
spec.setBoundaryCondition(false);
spec.setId("S");
spec.setInitialConcentration(5);
mod2.addSpecies(spec);
spec.setId("D");
spec.setInitialConcentration(10);
//.........这里部分代码省略.........