Ejemplo n.º 1
0
        public RelationshipModel2(
            SynteticDataBuilderV1 databuilder,
            Func <PersonWithMetadata, double> pParentNinExists_GivenHaveParentNin,
            Func <PersonWithMetadata, double> pParentSameSex_GivenHaveValidParentNin,
            Func <PersonWithMetadata, Tuple <bool, bool, bool> > hasFatherHasMotherHasSpouse,
            Func <PersonWithMetadata, int> getAgeDifferenceInYearsToParent,
            Func <PersonWithMetadata, int> numberOfChildrenGivenHaveChildren,
            Func <PersonWithMetadata, int> getSpouseAgeDifferential,
            Func <PersonWithMetadata, double> pSpouseExists_GivenHasSpouse,
            Func <PersonWithMetadata, double> pSpouseSameSex_GivenHasValidSpouse,
            Func <PersonWithMetadata, double> pSpouseDuplex_GivenHasValidSpouse,
            Func <PersonWithMetadata, double> pParentsAreMarried_GivenhaveMotherAndFather
            ) : base(databuilder)
        {
            _pParentNinExists_GivenHaveParentNin    = pParentNinExists_GivenHaveParentNin;
            _pParentSameSex_GivenHaveValidParentNin = pParentSameSex_GivenHaveValidParentNin;
            _hasFatherHasMotherHasSpouse            = hasFatherHasMotherHasSpouse;
            _getAgeDifferenceInYearsToParent        = getAgeDifferenceInYearsToParent;
            _numberOfChildrenGivenHaveChildren      = numberOfChildrenGivenHaveChildren;
            _getSpouseAgeDifferential                    = getSpouseAgeDifferential;
            _pSpouseExists_GivenHasSpouse                = pSpouseExists_GivenHasSpouse;
            _pSpouseSameSex_GivenHasValidSpouse          = pSpouseSameSex_GivenHasValidSpouse;
            _pSpouseDuplex_GivenHasValidSpouse           = pSpouseDuplex_GivenHasValidSpouse;
            _pParentsAreMarried_GivenhaveMotherAndFather = pParentsAreMarried_GivenhaveMotherAndFather;

            Reset();
        }
Ejemplo n.º 2
0
 public AdressModel(SynteticDataBuilderV1 databuilder) : base(databuilder)
 {
     _nameModel        = new NameModel(databuilder);
     _adressStatistics = _model.Statistics.AdressStatistics;
     GenerateAdressList();
     SetPostalcodesAndMunicipalityCodes();
 }
        public NameModel(SynteticDataBuilderV1 databuilder) : base(databuilder)
        {
            _pHasFirstname  = (person) => _model.Statistics.NameStatistics.HasFirstname.TrueRatioPercent;
            _pHasMiddlename = (person) => _model.Statistics.NameStatistics.HasMiddlename.TrueRatioPercent;
            _pHasSirname    = (person) => _model.Statistics.NameStatistics.HasSirname.TrueRatioPercent;
            _givenHasFirstNameHowManyNames        = (person) => _model.Statistics.NameStatistics.GivenHasFirstName_HowManyNames.Sample(person.Randy) ?? 0;
            _givenHasMiddleNameHowManyNames       = (person) => _model.Statistics.NameStatistics.GivenHasMiddleName_HowManyNames.Sample(person.Randy) ?? 0;
            _givenHasHasSirnameHowManyNames       = (person) => _model.Statistics.NameStatistics.GivenHasHasSirname_HowManyNames.Sample(person.Randy) ?? 0;
            _givenHasMultipleSirnameUseBindestrek = (person) => _model.Statistics.NameStatistics.HasMultipleSirname_UseBindestrek.TrueRatioPercent;

            Setup();
        }
        public SivilstatusModel(SynteticDataBuilderV1 databuilder) : base(databuilder)
        {
            _getMaritialstatusAndDate = (person) =>
            {
                var statistics = _model.Statistics.GetClosestStatisticByAgeQuant(person).SivilstatusStatistics;

                var status = person.Person.SpouseNIN != null?
                             statistics.Sivilstatus_GivenHasSpouse.GetValue(person.Randy.NextDouble()) :
                                 statistics.Sivilstatus_GivenHasNotSpouse.GetValue(person.Randy.NextDouble());

                var date = statistics.DateDifference.GetDateTimeFromModel(person, status);

                return(new Tuple <int?, DateTime?>(status, date));
            };
        }
Ejemplo n.º 5
0
        public IdentificatorModel(SynteticDataBuilderV1 databuilder, IdentifierDublicateControl idControl) : base(databuilder)
        {
            _idControl        = idControl;
            _getKjonnIsFemale = (person) =>
            {
                if (person.HasDnummer)
                {
                    return(_model.Statistics.GetClosestStatisticByAgeQuant(person).HasDnummer_Kjonn.Sample(person.Randy).Value == 2);
                }

                return((int)_model.Statistics.GetClosestStatisticByAgeQuant(person).Kjonn.Sample(person.Randy).Value == 2);
            };


            _pDufNo      = (person) => _model.Statistics.GetClosestStatisticByAgeQuant(person).HasDufNo.TrueRatioPercent;
            _pHasDnummer = (person) => _model.Statistics.GetClosestStatisticByAgeQuant(person).HasDnummer.TrueRatioPercent;
            _pHasNewNin  = (person) => _model.Statistics.GetClosestStatisticByAgeQuant(person).HasNewNIN.TrueRatioPercent;
            _pHasOldNin  = (person) => _model.Statistics.GetClosestStatisticByAgeQuant(person).HasOldNIN.TrueRatioPercent;
        }
        private Task CreateTask(int number, CancellationToken cancelToken, int howManyIterationPerThread, int bunchSize)
        {
            return(Task.Run(async() =>
            {
                var sessionId = number.ToString();
                var modelClone = _model.Clone();
                BuildDistributionModels(modelClone);

                var builder = new SynteticDataBuilderV1(modelClone, _pusherPregData, IdControl);

                Outputter.WriteLine($"[Thread: {sessionId}]: starting");

                for (int j = 0; j < howManyIterationPerThread; j++)
                {
                    builder.Do(sessionId, bunchSize);
                    Outputter.WriteLine($"[Thread: {sessionId}]: done with iteration {j} of {howManyIterationPerThread - 1}");

                    bool hasWritten = false;
                    bool hasHolded = false;
                    while (_holdOn)
                    {
                        hasHolded = true;
                        if (!hasWritten)
                        {
                            Outputter.WriteLine($"[Thread: {sessionId}]: holding .. ");
                        }

                        hasWritten = true;
                        await Task.Delay(1000, cancelToken);
                    }
                    if (hasHolded)
                    {
                        Outputter.WriteLine($"[Thread: {sessionId}]: starting again .. ");
                    }
                }
            }, cancelToken));
        }
Ejemplo n.º 7
0
 public FamilyModel(SynteticDataBuilderV1 databuilder) : base(databuilder)
 {
 }
 public RegstatusModel(SynteticDataBuilderV1 databuilder) : base(databuilder)
 {
 }
 public BaseModel(SynteticDataBuilderV1 databuilder)
 {
     _databuilder = databuilder;
 }