Esempio n. 1
0
 public static string incomeLevel2Str(Util.Resource resource, IncomeLevel level)
 {
     switch (level)
     {
         case IncomeLevel.GOOD: return resource.getMsg("good");
         case IncomeLevel.BAD: return resource.getMsg("bad");
         default: return resource.getMsg("good");
     }
 }
Esempio n. 2
0
 public static uint ConvertLevelToValue(IncomeLevel currHhldIncLvl)
 {
     uint income = 0;
     if (currHhldIncLvl == IncomeLevel.ThirtyOrLess)
     {
         if (randGen.NextDouble() > 0.3)
         {
             income = (uint)Math.Round(
                 randGen.NextDoubleInRange(10000, 30000));
         }
         else
         {
             income = (uint)Math.Round(
                 randGen.NextDoubleInRange(1000, 10000));
         }
     }
     else if (currHhldIncLvl == IncomeLevel.ThirtyToSevetyFive)
     {
         income = (uint)Math.Round(randGen.NextDoubleInRange(30000, 75000), 0);
     }
     else if (currHhldIncLvl == IncomeLevel.SeventyFiveToOneTwentyFive)
     {
         income = (uint)Math.Round(randGen.NextDoubleInRange(75000, 125000), 0);
     }
     else if (currHhldIncLvl == IncomeLevel.OneTwentyFiveToTwoHundred)
     {
         income = (uint)Math.Round(randGen.NextDoubleInRange(125000, 200000), 0);
     }
     else
     {
         if (randGen.NextDouble() > 0.3)
         {
             income = (uint)Math.Round(randGen.NextDoubleInRange(200000, 2000000), 0);
         }
         else
         {
             income = (uint)Math.Round(randGen.NextDoubleInRange(2000000, 10000000), 0);
         }
     }
     return income;
 }
Esempio n. 3
0
 public void SetIncomeLevel(IncomeLevel incomeLvl)
 {
     myIncomeLevel = incomeLvl;
 }
Esempio n. 4
0
 private Household(Household copyFrom)
 {
     myHhhldSize = copyFrom.myHhhldSize;
     numberOfAdults = copyFrom.numberOfAdults;
     myDwellType = copyFrom.myDwellType;
     myNumOfCars = copyFrom.myNumOfCars;
     myNumOfWorkers = copyFrom.myNumOfWorkers;
     myNumOfPeople = copyFrom.myNumOfPeople;
     myNumOfKids = copyFrom.myNumOfKids;
     myNumofUnivDeg = copyFrom.myNumofUnivDeg;
     myIncomeLevel = copyFrom.myIncomeLevel;
     myIncome = copyFrom.myIncome;
     Type = copyFrom.Type;
     myZoneID = copyFrom.myZoneID;
     myID = idCounter++;
 }
Esempio n. 5
0
 public Household(string currZone)
 {
     myZoneID = currZone;
     myHhhldSize = HouseholdSize.Twoadults;
     myDwellType = DwellingType.House;
     myNumOfCars = NumOfCars.OneCar;
     myNumOfWorkers = NumOfWorkers.One;
     myNumOfPeople = NumOfPeople.Two;
     myNumOfKids = NumOfKids.None;
     myNumofUnivDeg = NumWithUnivDeg.One;
     myIncomeLevel = IncomeLevel.SeventyFiveToOneTwentyFive;
     myIncome = 80000;
     Type = AgentType.Household;
     myID = idCounter++;
 }
Esempio n. 6
0
        public Household(HouseholdSize size, string currZone)
        {
            myID = idCounter++;
            switch (size)
            {
                case (HouseholdSize.SingleAdult):
                    numberOfAdults = 1;
                    myHhhldSize = HouseholdSize.SingleAdult;
                    break;
                case (HouseholdSize.OneAdultOneChild):
                    numberOfAdults = 1;
                    myHhhldSize = HouseholdSize.OneAdultOneChild;
                    break;
                case (HouseholdSize.Twoadults):
                    myHhhldSize = HouseholdSize.Twoadults;
                    numberOfAdults = 2;
                    break;
                case (HouseholdSize.TwoAdultsChildren):
                    myHhhldSize = HouseholdSize.TwoAdultsChildren;
                    numberOfAdults = 2;
                    break;
                case (HouseholdSize.ThreeOrMoreAdults):
                    myHhhldSize = HouseholdSize.ThreeOrMoreAdults;
                    numberOfAdults = 3;
                    break;
                case (HouseholdSize.ThreeOrMoreAdultsChildren):
                    myHhhldSize = HouseholdSize.ThreeOrMoreAdultsChildren;
                    numberOfAdults = 3;
                    break;
                default:
                    break;
            }

            myZoneID = currZone;
            myDwellType = DwellingType.House;
            myNumOfCars = NumOfCars.OneCar;
            myNumOfWorkers = NumOfWorkers.One;
            myNumOfPeople = NumOfPeople.Two;
            myNumOfKids = NumOfKids.None;
            myNumofUnivDeg = NumWithUnivDeg.None;
            myIncomeLevel = IncomeLevel.SeventyFiveToOneTwentyFive;
            myIncome = 80000;
            Type = AgentType.Household;
        }
Esempio n. 7
0
 public static int GetEuroIncome(IncomeLevel currHhldIncLvl)
 {
     int income = 0;
     if (currHhldIncLvl == IncomeLevel.ThirtyOrLess)
     {
         income = (int)Math.Round(randGen.NextDoubleInRange(20000, 30000) /
             Constants.BFRANC_TO_EURO, 0);
     }
     else if (currHhldIncLvl == IncomeLevel.ThirtyToSevetyFive)
     {
         income = (int)Math.Round(randGen.NextDoubleInRange(30000, 75000) /
             Constants.BFRANC_TO_EURO, 0);
     }
     else if (currHhldIncLvl == IncomeLevel.SeventyFiveToOneTwentyFive)
     {
         income = (int)Math.Round(randGen.NextDoubleInRange(75000, 125000) /
             Constants.BFRANC_TO_EURO, 0);
     }
     else if (currHhldIncLvl == IncomeLevel.OneTwentyFiveToTwoHundred)
     {
         income = (int)Math.Round(randGen.NextDoubleInRange(125000, 200000) /
             Constants.BFRANC_TO_EURO, 0);
     }
     else
     {
         income = (int)Math.Round(randGen.NextDoubleInRange(200000, 1000000) /
             Constants.BFRANC_TO_EURO, 0);
     }
     return income;
 }