// For zone by zone information (conditionals as columns) public string FillCollection1(DiscreteCondDistribution currColl) { string strTok = FileReader.ReadLine(); if (strTok != null) { string[] strColl = strTok.Split(','); for (int i = 0; i < ConditionalNames.Count; i++) { string currCond = (string) ConditionalNames[i]; string[] currDimVal = currCond.Split( Utils.Constants.CATEGORY_DELIMITER[0]); currColl.AddValue(currDimVal[0], currDimVal[1], uint.Parse(strColl[i+1])); } return strColl[0]; } return ""; }
// For 1 values for all zones (conditionals as rows) public void FillCollection2(DiscreteCondDistribution currColl) { string strTok = FileReader.ReadLine(); while ((strTok = FileReader.ReadLine()) != null) { string[] strToken = strTok.Split(','); int j = strToken[0].IndexOf( Utils.Constants.CATEGORY_DELIMITER); string catName = strToken[0].Substring(0, j); string condName = strToken[0].Substring(j + 1, strToken[0].Length - (catName.Length + 1)); /*string[] strToken = strTok.Split(','); //int j = strToken[0].IndexOf( // Utils.Constants.CATEGORY_DELIMITER); string catName = strTok.Substring(0,1); string condName = strTok.Substring(2, strTok.LastIndexOf(',')-2);*/ currColl.AddValue(catName, condName, double.Parse(strToken[1])); } }
private void InitializeInputData(AgentType currType) { if (currType == AgentType.Household) { mobelWrkrsConditionals = new DiscreteCondDistribution(); mobelKidsConditionals = new DiscreteCondDistribution(); mobelPersConditionals = new DiscreteCondDistribution(); } }
/////////////////////////////////// public SpatialZone() { /////////////////////////////////// // For Household Synthesis //censusPersonConditionals = new DiscreteCondDistribution(); modelIncConditionals = new ModelDistribution(); modelIncConditionals.SetDimensionName("IncomeLevel"); modelUnivDegConditionals = new ModelDistribution(); modelUnivDegConditionals.SetDimensionName("NumWithUnivDeg"); modelDwellConditionals = new ModelDistribution(); modelDwellConditionals.SetDimensionName("DwellingType"); modelCarsConditionals = new ModelDistribution(); modelCarsConditionals.SetDimensionName("NumOfCars"); modelNumberOfPeopleConditionals = new ModelDistribution(); modelNumberOfPeopleConditionals.SetDimensionName("NumOfPeople"); modelKidsConditionals = new ModelDistribution(); modelKidsConditionals.SetDimensionName("NumOfKids"); modelHouseHoldTypeConditionals = new ModelDistribution(); modelHouseHoldTypeConditionals.SetDimensionName("HouseholdSize"); myDwellMarginal = new DiscreteMarginalDistribution(); myDwellMarginal.SetDimensionName("DwellingType"); myDwellMarginalCounts = new DiscreteMarginalDistribution(); myDwellMarginalCounts.SetDimensionName("DwellingType"); myCarsMarginal = new DiscreteMarginalDistribution(); myCarsMarginal.SetDimensionName("NumOfCars"); myPersonMarginal = new DiscreteMarginalDistribution(); myPersonMarginal.SetDimensionName("HouseholdSize"); /////////////////////////////////// /////////////////////////////////// // For Person Synthesis /* modelPublicTransitConditionals = new ModelDistribution(); modelPublicTransitConditionals.SetDimensionName("PublicTransitPass");*/ myHhldSize2Marginal = new DiscreteMarginalDistribution(); myHhldSize2Marginal.SetDimensionName("HouseholdSize2"); mySexMarginal = new DiscreteMarginalDistribution(); mySexMarginal.SetDimensionName("Sex"); myAgeMarginal = new DiscreteMarginalDistribution(); myAgeMarginal.SetDimensionName("Age"); myEducationMarginal = new DiscreteMarginalDistribution(); myEducationMarginal.SetDimensionName("EducationLevel"); myOccupationMarginal = new DiscreteMarginalDistribution(); myOccupationMarginal.SetDimensionName("Occupation"); myAgeConditional = new DiscreteCondDistribution(); myAgeConditional.SetDimensionName("Age"); mySexConditional = new DiscreteCondDistribution(); mySexConditional.SetDimensionName("Sex"); myHhldSizeConditional = new DiscreteCondDistribution(); myHhldSizeConditional.SetDimensionName("HouseholdSize2"); myEduLevelConditional = new DiscreteCondDistribution(); myEduLevelConditional.SetDimensionName("EducationLevel"); modelAgeConditionals = new ModelDistribution();// modelAgeConditionals.SetDimensionName("Age"); modelEmploymentStatus = new ModelDistribution();// modelEmploymentStatus.SetDimensionName("EmploymentStatus"); /* modelPublicTransitConditionals = new ModelDistribution();// modelPublicTransitConditionals.SetDimensionName("PublicTransitPass");*/ modelOccupationConditionals = new ModelDistribution();// modelOccupationConditionals.SetDimensionName("Occupation"); modelSexConditionals = new ModelDistribution();// modelSexConditionals.SetDimensionName("Sex"); modelDriverLicenseConditionals = new ModelDistribution();// modelDriverLicenseConditionals.SetDimensionName("DrivingLicense"); }
/////////////////////////////////// public SpatialZone() { /////////////////////////////////// // For Household Synthesis //censusPersonConditionals = new DiscreteCondDistribution(); modelIncConditionals = new ModelDistribution(); modelIncConditionals.SetDimensionName("IncomeLevel"); modelUnivDegConditionals = new ModelDistribution(); modelUnivDegConditionals.SetDimensionName("NumWithUnivDeg"); modelDwellConditionals = new ModelDistribution(); modelDwellConditionals.SetDimensionName("DwellingType"); modelCarsConditionals = new ModelDistribution(); modelCarsConditionals.SetDimensionName("NumOfCars"); myDwellMarginal = new DiscreteMarginalDistribution(); myDwellMarginal.SetDimensionName("DwellingType"); myDwellMarginalCounts = new DiscreteMarginalDistribution(); myDwellMarginalCounts.SetDimensionName("DwellingType"); myCarsMarginal = new DiscreteMarginalDistribution(); myCarsMarginal.SetDimensionName("NumOfCars"); myPersonMarginal = new DiscreteMarginalDistribution(); myPersonMarginal.SetDimensionName("HouseholdSize"); /////////////////////////////////// /////////////////////////////////// // For Person Synthesis myHhldSize2Marginal = new DiscreteMarginalDistribution(); myHhldSize2Marginal.SetDimensionName("HouseholdSize2"); mySexMarginal = new DiscreteMarginalDistribution(); mySexMarginal.SetDimensionName("Sex"); myAgeMarginal = new DiscreteMarginalDistribution(); myAgeMarginal.SetDimensionName("MaritalStatus"); myEducationMarginal = new DiscreteMarginalDistribution(); myEducationMarginal.SetDimensionName("EducationLevel"); myAgeConditional = new DiscreteCondDistribution(); myAgeConditional.SetDimensionName("Age"); mySexConditional = new DiscreteCondDistribution(); mySexConditional.SetDimensionName("Sex"); myHhldSizeConditional = new DiscreteCondDistribution(); myHhldSizeConditional.SetDimensionName("HouseholdSize2"); myEduLevelConditional = new DiscreteCondDistribution(); myEduLevelConditional.SetDimensionName("EducationLevel"); }