示例#1
0
        public void RetrieveDefaultValueFor(IndividualSettingsDTO individualSettingsDTO)
        {
            individualSettingsDTO.SubPopulation = _subPopulationDTOMapper.MapFrom(_originDataTask.DefaultSubPopulationFor(individualSettingsDTO.Species));
            //Default parameter such as age etc.. were not defined yet
            var originData   = _originDataMapper.MapFrom(individualSettingsDTO);
            var parameterAge = _parameterMapper.MapAsReadWriteFrom(_individualModelTask.MeanAgeFor(originData));

            originData.Age = parameterAge.KernelValue;

            var parameterGestationalAge = _parameterMapper.MapAsReadWriteFrom(_individualModelTask.MeanGestationalAgeFor(originData));

            originData.GestationalAge = parameterGestationalAge.KernelValue;
            setDefaultValues(individualSettingsDTO, originData, parameterAge, parameterGestationalAge);
        }
        public void UpdateDefaultValueFor(IndividualSettingsDTO individualSettingsDTO)
        {
            individualSettingsDTO.SubPopulation = _subPopulationDTOMapper.MapFrom(_originDataTask.DefaultSubPopulationFor(individualSettingsDTO.Species));
            //Default parameter such as age etc.. were not defined yet
            var originData   = _originDataMapper.MapFrom(individualSettingsDTO);
            var parameterAge = _individualModelTask.MeanAgeFor(originData);

            if (parameterAge != null)
            {
                originData.Age = new OriginDataParameter(parameterAge.Value);
            }

            var parameterGestationalAge = _individualModelTask.MeanGestationalAgeFor(originData);

            if (parameterGestationalAge != null)
            {
                originData.GestationalAge = new OriginDataParameter(parameterGestationalAge.Value);
            }

            setDefaultValues(individualSettingsDTO, originData, _parameterMapper.MapAsReadWriteFrom(parameterAge), _parameterMapper.MapAsReadWriteFrom(parameterGestationalAge));
        }
 public Individual DefaultIndividualFor(SpeciesPopulation speciesPopulation)
 {
     if (!_indvidualCacheProSpecies.Contains(speciesPopulation))
     {
         var species       = _speciesRepository.FindByName(speciesPopulation.Species);
         var individualDTO = _individualDefaultValueRetriever.DefaultSettingForSpecies(species);
         individualDTO.SpeciesPopulation = speciesPopulation;
         _individualDefaultValueRetriever.RetrieveDefaultValueFor(individualDTO);
         _indvidualCacheProSpecies[speciesPopulation] = _individualFactory.CreateStandardFor(_individualSettingsMapper.MapFrom(individualDTO));
     }
     return(_indvidualCacheProSpecies[speciesPopulation]);
 }
        public Individual DefaultIndividualFor(SpeciesPopulation speciesPopulation)
        {
            if (!_indvidualCacheProSpecies.Contains(speciesPopulation))
            {
                var individualDTO = _individualDefaultValueRetriever.DefaultSettingFor(speciesPopulation);
                _indvidualCacheProSpecies[speciesPopulation] = _individualFactory.CreateStandardFor(_individualSettingsMapper.MapFrom(individualDTO));
            }

            return(_indvidualCacheProSpecies[speciesPopulation]);
        }
示例#5
0
 public PKSim.Core.Model.Individual MapFrom(IndividualSettingsDTO individualSettingsDTO)
 {
     return(_individualFactory.CreateAndOptimizeFor(_mapper.MapFrom(individualSettingsDTO)));
 }
 public Individual MapFrom(IndividualSettingsDTO individualSettingsDTO)
 {
     return(_individualFactory.CreateAndOptimizeFor(_originDataMapper.MapFrom(individualSettingsDTO)));
 }