Пример #1
0
        public Household GetHousehold(Age age)
        {
            Household household = new Household();

            household.NumberOfAdults = GetRandom(_adults);
            household.NumberOfTeenagers = GetRandom(_minors);
            while (age == Age.Range1 && household.NumberOfTeenagers == 0)
            {
                household.NumberOfTeenagers = GetRandom(_minors);
            }
            household.NumberOfChildren = GetRandom(_minors);
            household.NumberOfBabies = GetRandom(_minors);

            return household;
        }
Пример #2
0
        public AdultMembers GetAdultMembers(Age age, Household household)
        {
            AdultMembers adults = new AdultMembers();
            if (age == Age.Range1)
            {
                adults.Student++;
            }
            else if (age == Age.Range6)
            {
                adults.Retired++;
            }
            while (adults.Total < household.NumberOfAdults)
            {
                AdultOccupations occupation = GetRandom(_occupations);
                if (occupation == AdultOccupations.WorkingFullTime)
                {
                    adults.WorkingFullTime++;
                }
                else if (occupation == AdultOccupations.WorkingPartTime)
                {
                    adults.WorkingPartTime++;
                }
                else if (occupation == AdultOccupations.Retired)
                {
                    adults.Retired++;
                }
                else if (occupation == AdultOccupations.Unemployed)
                {
                    adults.Unemployed++;
                }
                else if (occupation == AdultOccupations.Student)
                {
                    adults.Student++;
                }
            }

            return adults;
        }