Esempio n. 1
0
        /// <summary>
        /// Get a collection of InitialConditionDistribution objects for the specified Iteration
        /// </summary>
        /// <param name="iteration"></param>
        /// <returns></returns>
        /// <remarks></remarks>
        public InitialConditionsDistributionCollection GetForIteration(int?iteration)
        {
            InitialConditionsDistributionCollection icds = new InitialConditionsDistributionCollection();

            foreach (InitialConditionsDistribution icd in this)
            {
                if (Nullable.Equals(icd.Iteration, iteration))
                {
                    icds.Add(icd);
                }
            }

            return(icds);
        }
Esempio n. 2
0
        /// <summary>
        /// Get a Filtered Collection of InitialConditionsDistribution for specified parameter
        /// </summary>
        /// <returns>A Collection of InitialConditionsDistribution</returns>
        /// <remarks></remarks>
        public InitialConditionsDistributionCollection GetFiltered(Cell cell)
        {
            InitialConditionsDistributionCollection ICDCollection = new InitialConditionsDistributionCollection();

            foreach (InitialConditionsDistribution icd in this)
            {
                if (cell.StratumId != icd.StratumId)
                {
                    continue;
                }

                if (cell.StateClassId != Spatial.DefaultNoDataValue)
                {
                    if (cell.StateClassId != icd.StateClassId)
                    {
                        continue;
                    }
                }

                if (cell.SecondaryStratumId != Spatial.DefaultNoDataValue)
                {
                    if (cell.SecondaryStratumId != icd.SecondaryStratumId)
                    {
                        continue;
                    }
                }

                if (cell.TertiaryStratumId != Spatial.DefaultNoDataValue)
                {
                    if (cell.TertiaryStratumId != icd.TertiaryStratumId)
                    {
                        continue;
                    }
                }

                if (cell.Age != Spatial.DefaultNoDataValue)
                {
                    if (cell.Age < icd.AgeMin || cell.Age > icd.AgeMax)
                    {
                        continue;
                    }
                }

                // Passed all the tests, so we'll take this one
                ICDCollection.Add(icd);
            }

            return(ICDCollection);
        }