コード例 #1
0
ファイル: Divorce.cs プロジェクト: l5d1l5/ILUTE
        public void BeforeFirstYear(int firstYear)
        {
            FirstYear = firstYear;
            // Seed the Random Number Generator
            RandomStream.CreateRandomStream(ref RandomGenerator, Seed);
            // load in the data we will use for rates
            List <float> data = new List <float>();

            using (CsvReader reader = new CsvReader(DivorceRatesFile, true))
            {
                int columns;
                while (reader.LoadLine(out columns))
                {
                    if (columns >= 2)
                    {
                        float temp;
                        reader.Get(out temp, 1);
                        data.Add(temp);
                    }
                }
            }
            DivorceData = data.ToArray();
            // process the data so to remove all of the divides needed to replicate
            // BaseSurvival = DivorceData[MarriageDuration]/DivorceData[MarriageDuration - 1]
            for (int i = DivorceData.Length - 1; i > 0; i--)
            {
                DivorceData[i] = DivorceData[i] / DivorceData[i - 1];
            }
        }
コード例 #2
0
ファイル: BirthModel.cs プロジェクト: l5d1l5/ILUTE
 public void BeforeFirstYear(int firstYear)
 {
     FirstYear = firstYear;
     // Seed the Random Number Generator
     RandomStream.CreateRandomStream(ref RandomGenerator, Seed);
     // load in the data we will use for rates
     BirthRateData = FileUtility.LoadAllDataToFloat(BirthRatesFileLocation, false);
 }
コード例 #3
0
 public void BeforeFirstYear(int firstYear)
 {
     FirstYear = firstYear;
     // Seed the Random Number Generator
     RandomStream.CreateRandomStream(ref RandomGenerator, Seed);
     NumberOfImmigrantsBySimulationYear = FileUtility.LoadAllDataToInt(ImmigrantsByYear, false);
     HouseholdTypeData = FileUtility.LoadAllDataToFloat(HouseholdDistributions, false);
 }
コード例 #4
0
 public void BeforeFirstYear(int firstYear)
 {
     FirstYear = firstYear;
     RandomStream.CreateRandomStream(ref RandomGenerator, Seed);
     // 0.0162072617395099F goes at the end because in the old model 1986 was the base year, but the first simulated year was actually 1987
     OutMigrationRates = new float[] { 0.0271659618478562F, 0.0303916293418877F, 0.0272732029843644F, 0.0220824955156408F, 0.0213697786084989F, 0.0177289505220036F
                                       , 0.0160643425773606F, 0.0147738571582634F, 0.0138364011036988F, 0.015226569069734F, 0.0155279653934537F, 0.0148450065745448F, 0.0178320039233872F,
                                       0.0160084860346674F, 0.0186621669919191F, 0.0182672232069938F, 0.0172703521451992F, 0.0159722481340647F, 0.0144900720933214F, 0.0162072617395099F };
 }
コード例 #5
0
 public void BeforeFirstYear(int firstYear)
 {
     // this model executes in the second year since the population is known during synthesis
     FirstYear = firstYear;
     // Seed the Random Number Generator
     RandomStream.CreateRandomStream(ref RandomGenerator, Seed);
     // load in the data we will use for rates
     DeathRateData = FileUtility.LoadAllDataToFloat(DeathRatesFileLocation, false);
 }
コード例 #6
0
 public void BeforeFirstYear(int firstYear)
 {
     // this model executes in the second year since the population is known during synthesis
     _firstYear = firstYear;
     // Seed the Random Number Generator
     RandomStream.CreateRandomStream(ref _randomGenerator, Seed);
     // load in the data we will use for rates
     _marriageParticipationRateData = FileUtility.LoadAllDataToFloat(MarriageRatesFileLocation, false);
     VectorHelper.Multiply(_marriageParticipationRateData, _marriageParticipationRateData, ParticipationModification);
     _familyRepository = Repository.GetRepository(FamilyRepository);
 }