Ejemplo n.º 1
0
        private List<double> GetUtilityValuesForEmploymentStatus(Person person)
        {
            var currValues = new List<double>(5);

            currValues.Add(1);

            int twoAdultsChildren = Convert.ToInt32(person.GetHhld().GetHhldSize() == HouseholdSize.TwoAdultsChildren);
            int twoPlusAdults = Convert.ToInt32(person.GetHhld().GetHhldSize() == HouseholdSize.Twoadults
                || person.GetHhld().GetHhldSize() == HouseholdSize.ThreeOrMoreAdults);
            int threePlusCars = Convert.ToInt32(person.GetHhld().GetNumOfCars() == NumOfCars.ThreeOrMore);
            int lNo = Convert.ToInt32(person.GetDrivingLicense() == DrivingLicense.No);
            int apart = Convert.ToInt32(person.GetHhld().GetDwellingType() == DwellingType.Apartment);
            int town = Convert.ToInt32(person.GetHhld().GetDwellingType() == DwellingType.Townhouse);
            int profMan = Convert.ToInt32(person.GetOccupation() == Occupation.TradesProfessional);
            int retail = Convert.ToInt32(person.GetOccupation() == Occupation.TechnicalRetailSalesServiceNotEmployedUnknown);

            int eighteen = Convert.ToInt32(person.GetAge() == Age.EighteenToTwentyFive);
            int twentysix = Convert.ToInt32(person.GetAge() == Age.TwentySixToThirty);
            int thirtyone = Convert.ToInt32(person.GetAge() == Age.ThirtyOneToForty);
            int female = Convert.ToInt32(person.GetSex() == Sex.Female);
            int twoAdults = Convert.ToInt32(person.GetHhld().GetHhldSize() == HouseholdSize.Twoadults);
            int oneCar = Convert.ToInt32(person.GetHhld().GetNumOfCars() == NumOfCars.OneCar);
            int twoPlusAdultsChildren = Convert.ToInt32(person.GetHhld().GetHhldSize() == HouseholdSize.TwoAdultsChildren
                || person.GetHhld().GetHhldSize() == HouseholdSize.ThreeOrMoreAdultsChildren);

            currValues.Add(Math.Exp(-2.34 * 1.00 - 0.122 * twoAdults + -0.335 * twoAdultsChildren + -0.453 * twoPlusAdults + -0.248 * twoPlusAdultsChildren
                + -0.236 * apart + -0.323 * town + 0.104 * oneCar + 0.126 * threePlusCars + 0.522 * profMan + 0.802 * retail
                + -1.32 * eighteen + -0.711 * twentysix + -0.325 * thirtyone + -0.252 * female + 0.247 * lNo));

            int manConst = Convert.ToInt32(person.GetOccupation() == Occupation.Construction);
            int eleven = Convert.ToInt32(person.GetAge() == Age.ElevenToThirteen);
            int fiftyone = Convert.ToInt32(person.GetAge() == Age.FiftyOneToFiftyFour);
            int sixteen = Convert.ToInt32(person.GetAge() == Age.SixteenToSeventeen);

            currValues.Add(Math.Exp(-3.25 * 1.00 + -0.430 * twoAdultsChildren + -0.573 * twoPlusAdults + -0.456 * twoPlusAdultsChildren
                + -0.249 * town + 0.0881 * oneCar + -0.757 * manConst + 0.204 * profMan + 0.351 * retail + 8.78 * eleven + 3.50 * sixteen
                + -0.367 * eighteen + -1.06 * twentysix + -0.865 * thirtyone + -0.508 * fiftyone + 0.542 * female));

            int fourteen = Convert.ToInt32(person.GetAge() == Age.FourteenToFifteen);

            currValues.Add(Math.Exp(2.01 * 1.00 + -0.689 * twoPlusAdults + -0.0915 * twoPlusAdultsChildren + 0.0922 * apart
                + -0.240 * town + 0.398 * oneCar + -0.126 * threePlusCars + -17.7 * manConst + -17.9 * profMan + 14.6 * eleven
                + 5.15 * fourteen + 6.33 * sixteen + 0.646 * eighteen + -1.15 * twentysix + -1.45 * thirtyone + -1.31 * fiftyone
                + -0.280 * female + 2.15 * lNo + -19.6 * retail));

            currValues.Add(Math.Exp(-2.69 * 1.00 + 0.116 * twoAdults + -0.232 * twoAdultsChildren + 0.0514 * twoPlusAdults + 0.188 * apart
                + -0.103 * town + 0.0953 * oneCar + -0.164 * threePlusCars + -0.194 * manConst + 0.0903 * profMan + 0.914 * retail
                + 3.93 * fourteen + 5.99 * sixteen + 1.74 * eighteen + -0.317 * thirtyone + -0.392 * fiftyone + 0.853 * female
                + 0.462 * lNo + 7.15 * eleven));

            return currValues;
        }
Ejemplo n.º 2
0
        private List<double> GetUtilityValuesForSex(Person person)
        {
            var currValues = new List<double>(2);

            currValues.Add(1);

            int twoAdultsChildren = Convert.ToInt32(person.GetHhld().GetHhldSize() == HouseholdSize.TwoAdultsChildren);
            int twoPlusAdults = Convert.ToInt32(person.GetHhld().GetHhldSize() == HouseholdSize.Twoadults
                || person.GetHhld().GetHhldSize() == HouseholdSize.ThreeOrMoreAdults);
            int twoPlusAdultsChildren = Convert.ToInt32(person.GetHhld().GetHhldSize() == HouseholdSize.TwoAdultsChildren
                || person.GetHhld().GetHhldSize() == HouseholdSize.ThreeOrMoreAdultsChildren);
            int threePlusCars = Convert.ToInt32(person.GetHhld().GetNumOfCars() == NumOfCars.ThreeOrMore);
            int lNo = Convert.ToInt32(person.GetDrivingLicense() == DrivingLicense.No);
            int homeFT = Convert.ToInt32(person.GetEmploymentStatus() == EmploymentStatus.FullTimeHome);
            int homePT = Convert.ToInt32(person.GetEmploymentStatus() == EmploymentStatus.PartTimeHome);
            int PT = Convert.ToInt32(person.GetEmploymentStatus() == EmploymentStatus.PartTime);
            int town = Convert.ToInt32(person.GetHhld().GetDwellingType() == DwellingType.Townhouse);
            int manConst = Convert.ToInt32(person.GetOccupation() == Occupation.Construction);
            int profMan = Convert.ToInt32(person.GetOccupation() == Occupation.TradesProfessional);
            int retail = Convert.ToInt32(person.GetOccupation() == Occupation.TechnicalRetailSalesServiceNotEmployedUnknown);
            int oNE = Convert.ToInt32(person.GetEmploymentStatus() == EmploymentStatus.Unemployed);
            int eleven = Convert.ToInt32(person.GetAge() == Age.ElevenToThirteen);
            int sixteen = Convert.ToInt32(person.GetAge() == Age.SixteenToSeventeen);
            int eighteen = Convert.ToInt32(person.GetAge() == Age.EighteenToTwentyFive);
            int twentysix = Convert.ToInt32(person.GetAge() == Age.TwentySixToThirty);
            int fortyone = Convert.ToInt32(person.GetAge() == Age.FortyOneToFifty);
            int fiftyone = Convert.ToInt32(person.GetAge() == Age.FiftyOneToFiftyFour);
            int fiftyfive = Convert.ToInt32(person.GetAge() == Age.FiftyfiveToSixtyFour);
            int sixtyfivePlus = Convert.ToInt32(person.GetAge() == Age.MoreThanSixtyFive);

            currValues.Add(Math.Exp(0.436 * 1.00 + -0.261 * twoAdultsChildren + -0.174 * twoPlusAdults
                + -0.222 * twoPlusAdultsChildren + 0.0472 * threePlusCars + 0.443 * lNo + -0.267 * homeFT
                + 0.530 * homePT + 0.900 * PT + 0.0508 * town + -2.33 * manConst + -0.733 * profMan
                + -0.824 * retail + -0.329 * oNE + -0.451 * eleven + -0.354 * sixteen + -0.154 * eighteen
                + 0.371 * twentysix + 0.428 * fortyone + 0.326 * fiftyone + 0.216 * fiftyfive + -0.0818 * sixtyfivePlus));

            return currValues;
        }
Ejemplo n.º 3
0
        private void updateCounts(Person person)
        {
            {
                switch (person.GetAge())
                {
                    case (Age.LessThanEleven):
                        {
                            count_less11++;
                            break;
                        }
                    case (Age.ElevenToThirteen):
                        {
                            count_11++;
                            break;
                        }
                    case (Age.FourteenToFifteen):
                        {
                            count_14++;
                            break;
                        }
                    case (Age.SixteenToSeventeen):
                        {
                            count_16++;
                            break;
                        }
                    case (Age.EighteenToTwentyFive):
                        {
                            count_18++;
                            break;
                        }
                    case (Age.TwentySixToThirty):
                        {
                            count_26++;
                            break;
                        }
                    case (Age.ThirtyOneToForty):
                        {
                            count_31++;
                            break;
                        }
                    case (Age.FortyOneToFifty):
                        {
                            count_41++;
                            break;
                        }
                    case (Age.FiftyOneToFiftyFour):
                        {
                            count_51++;
                            break;
                        }
                    case (Age.FiftyfiveToSixtyFour):
                        {
                            count_55++;
                            break;
                        }
                    case (Age.MoreThanSixtyFive):
                        {
                            count_65++;
                            break;
                        }
                    default:
                        break;
                }
                switch (person.GetEmploymentStatus())
                {
                    case (EmploymentStatus.PartTime):
                        count_part_time++;
                        break;
                    case (EmploymentStatus.FullTimeHome):
                        count_full_time_home++;
                        break;
                    case (EmploymentStatus.FullTime):
                        count_full_time++;
                        break;
                    case (EmploymentStatus.PartTimeHome):
                        count_part_time_home++;
                        break;
                    case (EmploymentStatus.Unemployed):
                        count_unemployed++;
                        break;
                    default:
                        break;
                }
                switch (person.GetSex())
                {
                    case (Sex.Male):
                        count_male++;
                        break;
                    case (Sex.Female):
                        count_female++;
                        break;
                    default:
                        break;
                }
                switch (person.GetDrivingLicense())
                {
                    case (DrivingLicense.Yes):
                        count_driving_license_yes++;
                        break;
                    case (DrivingLicense.No):
                        count_driving_license_no++;
                        break;
                    default:
                        break;

                }
                switch (person.GetOccupation())
                {
                    case (Occupation.GeneralOffice):
                        {
                            count_general_office++;
                            break;
                        }
                    case (Occupation.ClericalManufacturing):
                        {
                            count_clerical_manufacturing++;
                            break;
                        }
                    case (Occupation.TradesProfessional):
                        {
                            count_professional_man++;
                            break;
                        }
                    case (Occupation.TechnicalRetailSalesServiceNotEmployedUnknown):
                        {
                            count_retail++;
                            break;
                        }
                    case (Occupation.Construction):
                        {
                            count_costruction_man++;
                            break;
                        }
                }
            }
        }