Esempio n. 1
0
        public virtual IReadOnlyList <double> AllValuesFor(string parameterPath)
        {
            if (IndividualPropertiesCache.Has(parameterPath))
            {
                return(IndividualPropertiesCache.ValuesFor(parameterPath));
            }

            return(defaultValuesWith(double.NaN));
        }
Esempio n. 2
0
        public virtual IReadOnlyList <double> AllPercentilesFor(string parameterPath)
        {
            if (IndividualPropertiesCache.Has(parameterPath))
            {
                return(IndividualPropertiesCache.PercentilesFor(parameterPath));
            }

            return(defaultValuesWith(CoreConstants.DEFAULT_PERCENTILE));
        }
Esempio n. 3
0
        private void validate(IndividualPropertiesCache individualValues, IImportLogger logger)
        {
            foreach (var parameterPath in individualValues.AllParameterPaths().ToList())
            {
                if (allParametersContains(parameterPath))
                {
                    continue;
                }

                logger.AddWarning(PKSimConstants.Warning.ParameterWithPathNotFoundInBaseIndividual(parameterPath));
                individualValues.Remove(parameterPath);
            }
        }
Esempio n. 4
0
        private void removeUnits(IndividualPropertiesCache individualValues, ParameterValues parameterValue)
        {
            var parameterPath = parameterValue.ParameterPath;

            if (allParametersContains(parameterPath))
            {
                return;
            }

            var pathWithUnitsRemoved = importedPathWithUnitsRemoved(parameterPath);

            if (allParametersContains(pathWithUnitsRemoved))
            {
                individualValues.RenamePath(parameterPath, pathWithUnitsRemoved);
                parameterValue.ParameterPath = pathWithUnitsRemoved;
            }
        }
Esempio n. 5
0
 private void updatePathsContaininUnits(IndividualPropertiesCache individualValues)
 {
     individualValues.AllParameterValues.ToList().Each(parameterValue => { removeUnits(individualValues, parameterValue); });
 }
Esempio n. 6
0
 private void mergeImportedIndividualsInPopulation(ImportPopulation importPopulation, IndividualPropertiesCache individualValues)
 {
     importPopulation.IndividualPropertiesCache.Merge(individualValues, _allParameters);
 }
Esempio n. 7
0
 protected Population() : base(PKSimBuildingBlockType.Population)
 {
     IndividualPropertiesCache = new IndividualPropertiesCache();
     SelectedDistributions     = new ParameterDistributionSettingsCache();
     Seed = Environment.TickCount;
 }
Esempio n. 8
0
 public virtual void Merge(IndividualPropertiesCache individualPropertiesCache, PathCache <IParameter> parameterCache)
 {
     AllCovariates.AddRange(individualPropertiesCache.AllCovariates);
     ParameterValuesCache.Merge(individualPropertiesCache.ParameterValuesCache, parameterCache);
 }
Esempio n. 9
0
 /// <summary>
 ///    Add one individual to the population
 /// </summary>
 /// <param name="individualProperties">properties of individual added to population</param>
 public virtual void AddIndividualProperties(IndividualProperties individualProperties)
 {
     IndividualPropertiesCache.Add(individualProperties);
 }
Esempio n. 10
0
 public virtual void RemoveAdvancedParameter(IAdvancedParameter advancedParameter)
 {
     AdvancedParameterCollection.RemoveAdvancedParameter(advancedParameter);
     IndividualPropertiesCache.Remove(advancedParameter.ParameterPath);
 }
Esempio n. 11
0
 public virtual IReadOnlyList <string> AllCovariateNames()
 {
     return(new List <string>(IndividualPropertiesCache.AllCovariatesNames().Union(new[] { CoreConstants.Covariates.POPULATION_NAME })));
 }
Esempio n. 12
0
 public virtual void GenerateRandomValuesFor(IAdvancedParameter advancedParameter)
 {
     IndividualPropertiesCache.SetValues(advancedParameter.ParameterPath, advancedParameter.GenerateRandomValues(NumberOfItems));
 }
Esempio n. 13
0
        public virtual IEnumerable <IParameter> AllVectorialParameters(IEntityPathResolver entityPathResolver)
        {
            var allParameters = AllParameters(entityPathResolver);

            return(IndividualPropertiesCache.AllParameterPaths().Select(p => allParameters[p]).Where(p => p != null));
        }