當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。