Exemplo n.º 1
0
        private List<double> GetUtilityValuesForNumberOfVehicles(
      HouseholdPersonComposite composite,SpatialZone curZ)
        {
            Household hhld = composite.getHousehold().CreateNewCopy();
            //String key = hhld.GetNewJointKey(GetDimensionName());
            //string[] curKeys = key.Split(Constants.CONDITIONAL_DELIMITER[0]);
            var currValues = new List<double>(4);
            int myNumOfCars = (int) hhld.GetNumOfCars();
            int dwellType = (int) hhld.GetDwellingType();
            int hhldSize = (int) hhld.GetHhldSize();

            currValues.Add(1);

            int apart = Convert.ToInt32(dwellType== 1);
            int town = Convert.ToInt32(dwellType == 2);

            double z_oneCar = curZ.GetCarMarginal().GetValue("1");

            int oneAdult = Convert.ToInt32(hhldSize == 0);
            int twoAdults = Convert.ToInt32(hhldSize == 2);
            int twoAdultsChildren = Convert.ToInt32(hhldSize == 3);
            int twoPlusAdults = Convert.ToInt32(hhldSize == 2 || hhldSize == 4);
            int h_lYes_1 = Convert.ToInt32(composite.Count_driving_license_yes == 1);
            int h_lYes_2 = Convert.ToInt32(composite.Count_driving_license_yes == 2);
            int h_lYes_3 = Convert.ToInt32(composite.Count_driving_license_yes == 3);
            int h_lNo_1 = Convert.ToInt32(composite.Count_driving_license_no == 1);
            int h_lNo_2 = Convert.ToInt32(composite.Count_driving_license_no == 2);
            int h_lNo_3 = Convert.ToInt32(composite.Count_driving_license_no == 3);
            int h_lNo_4Plus = Convert.ToInt32(composite.Count_driving_license_no >= 4);
            int h_FT_1 = Convert.ToInt32(composite.Count_full_time == 1);
            int h_FT_2 = Convert.ToInt32(composite.Count_full_time == 2);
            int h_FT_3Plus = Convert.ToInt32(composite.Count_full_time >= 3);
            int h_homeFT_1Plus = Convert.ToInt32(composite.Count_full_time_home >= 1);
            int h_homePT_1Plus = Convert.ToInt32(composite.Count_full_time_home >= 1);
            int h_eNE_1 = Convert.ToInt32(composite.Count_unemployed == 1);
            int h_eNE_2 = Convert.ToInt32(composite.Count_unemployed == 2);
            int h_eNE_3 = Convert.ToInt32(composite.Count_unemployed == 3);
            int h_eNE_4Plus = Convert.ToInt32(composite.Count_unemployed >= 4);
            int h_PT_1 = Convert.ToInt32(composite.Count_part_time == 1);
            int h_officeCler_1 = Convert.ToInt32(composite.Count_clerical_manufacturing == 1);
            int h_manConst_1 = Convert.ToInt32(composite.Count_costruction_man == 1);
            int h_manConst_2Plus = Convert.ToInt32(composite.Count_costruction_man >= 2);
            int h_profMan_1 = Convert.ToInt32(composite.Count_professional_man == 1);
            int h_profMan_2Plus = Convert.ToInt32(composite.Count_professional_man >= 2);
            int h_retail_1 = Convert.ToInt32(composite.Count_retail == 1);
            int h_retail_2 = Convert.ToInt32(composite.Count_retail == 2);
            int h_retail_3Plus = Convert.ToInt32(composite.Count_retail >= 3);
            int h_zero_1 = Convert.ToInt32(composite.Count_less11 == 1);
            int h_zero_2 = Convert.ToInt32(composite.Count_less11 == 2);
            int h_zero_3 = Convert.ToInt32(composite.Count_less11 == 3);
            int h_eleven_1Plus = Convert.ToInt32(composite.Count_11 >= 1);
            int h_fourteen_1Plus = Convert.ToInt32(composite.Count_14 >= 1);
            int h_sixteen_1Plus = Convert.ToInt32(composite.Count_16 >= 1);
            int h_eighteen_1 = Convert.ToInt32(composite.Count_18 == 1);
            int h_eighteen_2Plus = Convert.ToInt32(composite.Count_18 >= 2);
            int h_twentysix_1 = Convert.ToInt32(composite.Count_26 == 1);
            int h_twentysix_2Plus = Convert.ToInt32(composite.Count_26 >= 2);
            int h_thirtyone_1 = Convert.ToInt32(composite.Count_31 == 1);
            int h_thirtyone_2Plus = Convert.ToInt32(composite.Count_31 >= 2);
            int h_fortyone_1 = Convert.ToInt32(composite.Count_41 == 1);
            int h_fortyone_2Plus = Convert.ToInt32(composite.Count_41 >= 2);
            int h_fiftyone_1 = Convert.ToInt32(composite.Count_51 == 1);
            int h_fiftyone_2Plus = Convert.ToInt32(composite.Count_51 >= 2);
            int h_fiftyfive_1 = Convert.ToInt32(composite.Count_55 == 1);
            int h_fiftyfive_2Plus = Convert.ToInt32(composite.Count_55 >= 2);
            int h_sixtyfivePlus_1 = Convert.ToInt32(composite.Count_65 >= 1);
            int h_sixtyfivePlus_2Plus = Convert.ToInt32(composite.Count_65 >= 2);
            int h_male_1 = Convert.ToInt32(composite.Count_male == 1);
            int h_male_3 = Convert.ToInt32(composite.Count_male == 3);
            int h_female_2 = Convert.ToInt32(composite.Count_female == 2);

            currValues.Add(Math.Exp(2.48 * 1.00 + -1.19 * apart + -0.185 * town
                + -2.28 * z_oneCar + -4.09 * oneAdult + -4.25 * twoAdults + 0.197 * twoAdultsChildren
                + -4.08 * twoPlusAdults + 3.25 * h_lYes_1 + 3.00 * h_lYes_2 + 2.27 * h_lYes_3
                + -1.40 * h_lNo_1 + -2.88 * h_lNo_2 + -3.97 * h_lNo_3 + -5.66 * h_lNo_4Plus
                + 0.583 * h_FT_1 + 0.985 * h_FT_2 + 1.17 * h_FT_3Plus + 0.571 * h_homeFT_1Plus
                + 0.257 * h_homePT_1Plus + 0.468 * h_eNE_1 + 1.03 * h_eNE_2 + 1.40 * h_eNE_3
                + 1.81 * h_eNE_4Plus + 0.125 * h_PT_1 + 0.251 * h_officeCler_1 + 0.655 * h_manConst_1
                + 0.891 * h_manConst_2Plus + 0.440 * h_profMan_1 + 0.400 * h_profMan_2Plus
                + 0.368 * h_retail_1 + 0.560 * h_retail_2 + 1.28 * h_retail_3Plus
                + -3.05 * h_zero_1 + -1.84 * h_zero_2 + -1.07 * h_zero_3 + 1.16 * h_eleven_1Plus
                + 1.21 * h_fourteen_1Plus + 1.09 * h_sixteen_1Plus + 0.505 * h_eighteen_1
                + 0.973 * h_eighteen_2Plus + 0.328 * h_twentysix_1 + 0.915 * h_twentysix_2Plus
                + 0.564 * h_thirtyone_1 + 1.16 * h_thirtyone_2Plus
                + 0.664 * h_fortyone_1 + 1.46 * h_fortyone_2Plus + 0.754 * h_fiftyone_1
                + 1.66 * h_fiftyone_2Plus + 0.855 * h_fiftyfive_1 + 2.11 * h_fiftyfive_2Plus
                + 1.25 * h_sixtyfivePlus_1 + 2.63 * h_sixtyfivePlus_2Plus + 0.0863 * h_male_1
                + 0.200 * h_male_3 + -0.127 * h_female_2));

            double z_twoCars = curZ.GetCarMarginal().GetValue("2");

            int oneAdultChildren = Convert.ToInt32(hhldSize == 3);
            int h_male_2 = Convert.ToInt32(composite.Count_male == 2);
            int h_male_4Plus = Convert.ToInt32(composite.Count_male >= 4);
            int h_female_3 = Convert.ToInt32(composite.Count_female == 3);
            int h_female_4Plus = Convert.ToInt32(composite.Count_female >= 4);

            currValues.Add(Math.Exp(-0.577 * 1.00 + -2.39 * apart + -0.858 * town + 5.45 * z_twoCars
                + -5.05 * oneAdult + 0.460 * oneAdultChildren + -5.13 * twoAdults + 0.308 * twoAdultsChildren
                + -4.94 * twoPlusAdults + 1.28 * h_lYes_1 + 3.11 * h_lYes_2 + 2.49 * h_lYes_3
                + -2.06 * h_lNo_1 + -4.02 * h_lNo_2 + -5.62 * h_lNo_3 + -7.96 * h_lNo_4Plus
                + 1.09 * h_FT_1 + 1.91 * h_FT_2 + 1.93 * h_FT_3Plus + 0.898 * h_homeFT_1Plus
                +0.501 * h_homePT_1Plus + 0.450 * h_eNE_1 + 0.891 * h_eNE_2 + 1.26 * h_eNE_3
                + 1.51 * h_eNE_4Plus + 0.268 * h_PT_1 + 0.289 * h_officeCler_1 + 0.883 * h_manConst_1
                + 0.965 * h_manConst_2Plus + 0.652 * h_profMan_1 + 0.621 * h_profMan_2Plus
                + 0.512 * h_retail_1 + 0.736 * h_retail_2 + 1.32 * h_retail_3Plus + -3.76 * h_zero_1
                + -2.26 * h_zero_2 + -1.38 * h_zero_3 + 1.45 * h_eleven_1Plus + 1.40 * h_fourteen_1Plus
                + 0.935 * h_sixteen_1Plus + 0.163 * h_eighteen_1 + 0.433 * h_eighteen_2Plus
                + 0.281 * h_twentysix_1 + 0.870 * h_twentysix_2Plus + 0.480 * h_thirtyone_1
                + 1.15 * h_thirtyone_2Plus + 0.702 * h_fortyone_1 + 1.71 * h_fortyone_2Plus
                + 0.961 * h_fiftyone_1 + 2.11 * h_fiftyone_2Plus + 1.15 * h_fiftyfive_1
                + 2.68 * h_fiftyfive_2Plus + 1.45 * h_sixtyfivePlus_1 + 2.97 * h_sixtyfivePlus_2Plus
                + 0.900 * h_male_1 + 1.21 * h_male_2 + 1.85 * h_male_3 + 2.28 * h_male_4Plus
                + 0.328 * h_female_2 + 0.817 * h_female_3 + 1.35 * h_female_4Plus));

            double z_threePlusCars = curZ.GetCarMarginal().GetValue("3");

            currValues.Add(Math.Exp(-1.19 * 1.00 + -3.18 * apart + -1.55 * town + 15.2 * z_threePlusCars
                + -5.01 * oneAdult + -5.35 * twoAdults + -4.90 * twoPlusAdults + 1.09 * h_lYes_2
                + 1.93 * h_lYes_3 + -2.52 * h_lNo_1 + -4.78 * h_lNo_2 + -6.69 * h_lNo_3
                + -9.39 * h_lNo_4Plus + 1.18 * h_FT_1 + 2.15 * h_FT_2 + 2.67 * h_FT_3Plus + 1.18 * h_homeFT_1Plus
                + 0.669 * h_homePT_1Plus + 0.239 * h_eNE_1 + 0.537 * h_eNE_2 + 0.877 * h_eNE_3
                + 1.10 * h_eNE_4Plus + 0.250 * h_PT_1 + 0.312 * h_officeCler_1 + 1.02 * h_manConst_1
                + 1.10 * h_manConst_2Plus + 0.790 * h_profMan_1 + 0.769 * h_profMan_2Plus
                + 0.539 * h_retail_1 + 0.786 * h_retail_2 + 1.37 * h_retail_3Plus + -3.64 * h_zero_1
                + -2.18 * h_zero_2 + -1.16 * h_zero_3 + 1.28 * h_eleven_1Plus + 1.32 * h_fourteen_1Plus
                + 0.303 * h_sixteen_1Plus + 0.343 * h_twentysix_1 + 0.841 * h_twentysix_2Plus
                + 0.572 * h_thirtyone_1 + 1.27 * h_thirtyone_2Plus + 0.857 * h_fortyone_1 + 2.16 * h_fortyone_2Plus
                + 1.31 * h_fiftyone_1 + 2.87 * h_fiftyone_2Plus + 1.46 * h_fiftyfive_1
                + 3.36 * h_fiftyfive_2Plus + 1.70 * h_sixtyfivePlus_1 + 3.34 * 2.63 + 1.46 * h_male_1
                + 2.04 * h_male_2 + 3.00 * h_male_3 + 4.02 * h_male_4Plus + 0.594 * h_female_2
                + 1.45 * h_female_3 + 2.39 * h_female_4Plus));

            return currValues;
        }