libsbml.Model.getListOfSpecies C# (CSharp) Method

getListOfSpecies() public method

public getListOfSpecies ( ) : ListOfSpecies
return ListOfSpecies
        public ListOfSpecies getListOfSpecies()
        {
            IntPtr cPtr = libsbmlPINVOKE.Model_getListOfSpecies__SWIG_0(swigCPtr);
            ListOfSpecies ret = (cPtr == IntPtr.Zero) ? null : new ListOfSpecies(cPtr, false);
            return ret;
        }

Usage Example

Example #1
0
        /// <summary>
        /// [ SpeciesStruct ]
        /// [[ Id , Name , Compartment , InitialAmount , InitialConcentration , SubstanceUnit , SpatialSizeUnit , Unit , HasOnlySubstanceUnit , BoundaryCondition , Charge , Constant ]]
        /// </summary>
        /// <param name="aSBMLmodel"></param>
        /// <returns></returns>
        public static List<SpeciesStruct> getSpecies(Model aSBMLmodel)
        {
            List<SpeciesStruct> list = new List<SpeciesStruct>();

            ListOfSpecies listOfSpecies = aSBMLmodel.getListOfSpecies();
            for (int i = 0; i < listOfSpecies.size(); i++ )
            {
                Species aSpecies = aSBMLmodel.getSpecies(i);

                string anId_Sp = aSpecies.getId();
                string aName_Sp = aSpecies.getName();
                string aCompartment_Sp = aSpecies.getCompartment();

                double anInitialAmount_Sp = GetInitialAmount(aSpecies);
                double anInitialConcentration_Sp = GetInitialConcentration(aSpecies);

                string aSubstanceUnit_Sp = aSpecies.getSubstanceUnits();
                string aSpatialSizeUnit_Sp = aSpecies.getSpatialSizeUnits();
                string anUnit_Sp = aSpecies.getUnits();
                bool aHasOnlySubstanceUnit_Sp = aSpecies.getHasOnlySubstanceUnits();
                bool aBoundaryCondition_Sp = aSpecies.getBoundaryCondition();
                int aCharge_Sp = aSpecies.getCharge();
                bool aConstant_Sp = aSpecies.getConstant();

                SpeciesStruct species = new SpeciesStruct(
                    anId_Sp,
                    aName_Sp,
                    aCompartment_Sp,
                    anInitialAmount_Sp,
                    anInitialConcentration_Sp,
                    aSubstanceUnit_Sp,
                    aSpatialSizeUnit_Sp,
                    anUnit_Sp,
                    aHasOnlySubstanceUnit_Sp,
                    aBoundaryCondition_Sp,
                    aCharge_Sp,
                    aConstant_Sp);

                list.Add( species );
            }

            return list;
        }
All Usage Examples Of libsbml.Model::getListOfSpecies
Model