当前位置: 首页>>代码示例>>C#>>正文


C# SBMLDocument.setPkgRequired方法代码示例

本文整理汇总了C#中libsbmlcs.SBMLDocument.setPkgRequired方法的典型用法代码示例。如果您正苦于以下问题:C# SBMLDocument.setPkgRequired方法的具体用法?C# SBMLDocument.setPkgRequired怎么用?C# SBMLDocument.setPkgRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在libsbmlcs.SBMLDocument的用法示例。


在下文中一共展示了SBMLDocument.setPkgRequired方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

    public static void Main(string[] args)
    {
        //
        // Creates an SBMLNamespaces object with the given SBML level, version
        // package name, package version.
        //
        // (NOTE) By defualt, the name of package (i.e. "layout") will be used
        // if the arugment for the prefix is missing or empty. Thus the argument
        // for the prefix can be added as follows:
        //
        //    SBMLNamespaces sbmlns(3,1,"layout",1,"LAYOUT");
        //

        SBMLNamespaces sbmlns = new SBMLNamespaces (3, 1, "layout", 1);

        //
        // (NOTES) The above code creating an SBMLNamespaces object can be replaced
        //         with one of the following other styles.
        //
        // (1) Creates an SBMLNamespace object with a SBML core namespace and then
        //     adds a layout package namespace to the object.
        //
        //         SBMLNamespaces sbmlns(3,1);
        //         sbmlns.addPkgNamespace("layout",1);
        //
        //           OR
        //
        //         SBMLNamespaces sbmlns(3,1);
        //         sbmlns.addNamespace(LayoutExtension::XmlnsL3V1V1,"layout");
        //
        // (2) Creates a LayoutPkgNamespaces object (SBMLNamespace derived class for
        //     layout package. The class is basically used for createing an SBase derived
        //     objects belonging to the layout package) with the given SBML level, version,
        //     and package version
        //
        //        LayoutPkgNamespaces sbmlns(3,1,1);
        //

        // create the document

        SBMLDocument document = new SBMLDocument (sbmlns);

        // set the "required" attribute of layout package  to "true"
        document.setPkgRequired ("layout", true);

        // create the Model

        Model model = document.createModel ();
        model.setId ("TestModel");
        document.setModel (model);

        // create the Compartment

        Compartment compartment = model.createCompartment ();
        compartment.setId ("Compartment_1");
        compartment.setConstant (true);

        // create the Species

        Species species1 = model.createSpecies ();
        species1.setId ("Species_1");
        species1.setCompartment (compartment.getId ());
        species1.setHasOnlySubstanceUnits (false);
        species1.setBoundaryCondition (false);
        species1.setConstant (false);

        Species species2 = model.createSpecies ();
        species2.setId ("Species_2");
        species2.setCompartment (compartment.getId ());
        species2.setHasOnlySubstanceUnits (false);
        species2.setBoundaryCondition (false);
        species2.setConstant (false);

        // create the Reactions

        Reaction reaction1 = model.createReaction ();
        reaction1.setId ("Reaction_1");
        reaction1.setReversible (false);
        reaction1.setFast (false);

        SpeciesReference reference1 = reaction1.createReactant ();
        reference1.setSpecies (species1.getId ());
        reference1.setId ("SpeciesReference_1");
        reference1.setConstant (false);

        SpeciesReference reference2 = reaction1.createProduct ();
        reference2.setSpecies (species2.getId ());
        reference2.setId ("SpeciesReference_2");
        reference2.setConstant (false);

        Reaction reaction2 = model.createReaction ();
        reaction2.setId ("Reaction_2");
        reaction2.setReversible (false);
        reaction2.setFast (false);

        SpeciesReference reference3 = reaction2.createReactant ();
        reference3.setSpecies (species2.getId ());
        reference3.setId ("SpeciesReference_3");
        reference3.setConstant (false);

//.........这里部分代码省略.........
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:101,代码来源:example1-L3.cs


注:本文中的libsbmlcs.SBMLDocument.setPkgRequired方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。