Ejemplo n.º 1
0
        protected override void Context()
        {
            base.Context();

            _populationCharacteristics = new PopulationCharacteristics
            {
                Species    = CoreConstants.Species.HUMAN,
                Population = CoreConstants.Population.ICRP,
                Age        = new ParameterRange
                {
                    Min  = 0,
                    Max  = 80,
                    Unit = "year(s)",
                },
                Weight = new ParameterRange
                {
                    Min  = 70,
                    Unit = "kg",
                },
                NumberOfIndividuals = 10,
                ProportionOfFemales = 70,
                Seed = 2
            };

            _populationCharacteristics.AddMoleculeOntogeny(new MoleculeOntogeny {
                Molecule = "CYP3A4", Ontogeny = "CYP3A4"
            });
            _populationCharacteristics.AddMoleculeOntogeny(new MoleculeOntogeny {
                Molecule = "CYP2D6", Ontogeny = "CYP2D6"
            });
        }
Ejemplo n.º 2
0
        protected override void Context()
        {
            base.Context();

            _populationCharacteristics = new PopulationCharacteristics
            {
                Species    = CoreConstants.Species.HUMAN,
                Population = CoreConstants.Population.PRETERM,
                Age        = new ParameterRange
                {
                    Min  = 0,
                    Max  = 80,
                    Unit = "year(s)",
                },
                Weight = new ParameterRange
                {
                    Min  = 70,
                    Unit = "kg",
                },
                GestationalAge = new ParameterRange
                {
                    Min  = 30,
                    Max  = 35,
                    Unit = "week(s)",
                },

                NumberOfIndividuals = 10,
                ProportionOfFemales = 70
            };
        }
        public CreatePopulationResults CreatePopulation(PopulationCharacteristics populationCharacteristics)
        {
            var populationSettings = _populationSettingsMapper.MapToModel(populationCharacteristics, new SnapshotContext()).Result;

            validate(populationSettings);
            var population = _randomPopulationFactory.CreateFor(populationSettings, new CancellationToken(), seed: populationCharacteristics.Seed).Result;

            foreach (var moleculeOntogeny in populationCharacteristics.MoleculeOntogenies)
            {
                var allOntogeniesForSpecies = _ontogenyRepository.AllFor(populationCharacteristics.Individual.OriginData.Species);
                if (!allOntogeniesForSpecies.Any())
                {
                    continue;
                }

                var ontogeny = allOntogeniesForSpecies.FindByName(moleculeOntogeny.Ontogeny);
                if (ontogeny == null)
                {
                    continue;
                }

                var molecule = _individualEnzymeFactory.CreateEmpty().WithName(moleculeOntogeny.Molecule);
                molecule.Ontogeny = ontogeny;

                population.AddMolecule(molecule);
            }

            _ontogenyVariabilityUpdater.UpdateAllOntogenies(population);

            return(new CreatePopulationResults(population.IndividualValuesCache, population.Seed));
        }
Ejemplo n.º 4
0
        protected override void Context()
        {
            base.Context();

            _populationCharacteristics = new PopulationCharacteristics
            {
                Species    = CoreConstants.Species.HUMAN,
                Population = CoreConstants.Population.ICRP,
                Age        = new ParameterRange
                {
                    Min  = 20,
                    Max  = 15,
                    Unit = "year(s)",
                },
                NumberOfIndividuals = 10,
                ProportionOfFemales = 70
            };
        }