示例#1
0
            // --- External Behaviours:

            /// <summary>
            /// Determines quintile group of individual with given population index.
            /// </summary>
            public Group FindQuintile(int populationIndex)
            {
                if (Median.IsMember(populationIndex))
                {
                    return(Group.median);
                }                                                                    // NOTE: returns Median for 0-index 0-population case
                else
                {
                    if (Top.IsMember(populationIndex))
                    {
                        return(Group.top);
                    }
                    else
                    {
                        if (High.IsMember(populationIndex))
                        {
                            return(Group.high);
                        }
                        else
                        {
                            if (Low.IsMember(populationIndex))
                            {
                                return(Group.low);
                            }
                            else
                            {
                                return(Group.bottom);
                            }
                        }
                    }
                }
            }