Exemple #1
0
        public virtual IEnumerable <IParameter> AllVectorialParameters(IEntityPathResolver entityPathResolver)
        {
            var allParameters = new PathCache <IParameter>(entityPathResolver).For(All <IParameter>());

            return(ParameterValuesCache.AllParameterPaths().Select(p => allParameters[p])
                   .Union(Population.AllVectorialParameters(entityPathResolver)).Where(p => p != null));
        }
Exemple #2
0
        public virtual ParameterValuesCache Clone()
        {
            var clone = new ParameterValuesCache();

            AllParameterValues.Each(x => clone.Add(x.Clone()));
            return(clone);
        }
Exemple #3
0
        public virtual IEnumerable <IParameter> AllAdvancedParameters(IEntityPathResolver entityPathResolver)
        {
            var allParameters = new PathCache <IParameter>(entityPathResolver).For(All <IParameter>());

            //The path might not be defined in the model when importing parameters. Simply ignore them
            return(ParameterValuesCache.AllParameterPaths().Select(p => allParameters[p]).Where(p => p != null));
        }
Exemple #4
0
 public virtual void AddAdvancedParameter(AdvancedParameter advancedParameter, bool generateRandomValues = true)
 {
     advancedParameterCollection.AddAdvancedParameter(advancedParameter);
     //force generation of parameters if no values was defined in the cache
     if (generateRandomValues || !ParameterValuesCache.Has(advancedParameter.ParameterPath))
     {
         GenerateRandomValuesFor(advancedParameter);
     }
 }
Exemple #5
0
        public virtual IReadOnlyList <double> AllPercentilesFor(string parameterPath)
        {
            if (ParameterValuesCache.Has(parameterPath))
            {
                return(ParameterValuesCache.PercentilesFor(parameterPath));
            }

            return(Population.AllPercentilesFor(parameterPath));
        }
Exemple #6
0
        public virtual void Merge(ParameterValuesCache parameterValuesCache, PathCache <IParameter> parameterCache)
        {
            var numberOfNewItems = parameterValuesCache.Count;
            var currentCount     = Count;

            foreach (var parameterPath in parameterValuesCache.AllParameterPaths())
            {
                if (!Has(parameterPath))
                {
                    addDefaultValues(parameterCache, parameterPath, currentCount);
                }
                ParameterValuesFor(parameterPath).Merge(parameterValuesCache.ParameterValuesFor(parameterPath));
            }

            //fill up the one missing
            foreach (var parameterPath in AllParameterPaths())
            {
                if (!parameterValuesCache.Has(parameterPath))
                {
                    addDefaultValues(parameterCache, parameterPath, numberOfNewItems);
                }
            }
        }
Exemple #7
0
 public virtual void GenerateRandomValuesFor(AdvancedParameter advancedParameter)
 {
     ParameterValuesCache.SetValues(advancedParameter.ParameterPath, advancedParameter.GenerateRandomValues(NumberOfItems));
 }
Exemple #8
0
 public virtual ParameterValues ParameterValuesAt(int index)
 {
     return(ParameterValuesCache.ParameterValuesAt(index));
 }
Exemple #9
0
 public virtual ParameterValues ParameterValuesFor(string parameterPath)
 {
     return(ParameterValuesCache.ParameterValuesFor(parameterPath));
 }
Exemple #10
0
 public virtual void SetValues(string parameterPath, IEnumerable <double> newValues)
 {
     ParameterValuesCache.SetValues(parameterPath, newValues);
 }
Exemple #11
0
 public virtual IReadOnlyList <double> PercentilesFor(string parameterPath)
 {
     return(ParameterValuesCache.PercentilesFor(parameterPath));
 }
Exemple #12
0
 public IndividualPropertiesCache(ParameterValuesCache parameterValuesCache, IEnumerable <IndividualCovariates> allConvariates)
 {
     ParameterValuesCache = parameterValuesCache;
     AllCovariates        = new List <IndividualCovariates>(allConvariates);
 }
Exemple #13
0
 public virtual void Merge(IndividualPropertiesCache individualPropertiesCache, PathCache <IParameter> parameterCache)
 {
     AllCovariates.AddRange(individualPropertiesCache.AllCovariates);
     ParameterValuesCache.Merge(individualPropertiesCache.ParameterValuesCache, parameterCache);
 }
Exemple #14
0
 public virtual void RenamePath(string oldPath, string newPath)
 {
     ParameterValuesCache.RenamePath(oldPath, newPath);
 }
Exemple #15
0
 public virtual void Add(IReadOnlyCollection <ParameterValue> parameterValues)
 {
     ParameterValuesCache.Add(parameterValues);
 }
Exemple #16
0
 public virtual void Add(ParameterValues parameterValues)
 {
     ParameterValuesCache.Add(parameterValues);
 }
Exemple #17
0
 public virtual IEnumerable <string> AllParameterPaths()
 {
     return(ParameterValuesCache.AllParameterPaths());
 }
Exemple #18
0
 public virtual IndividualPropertiesCache Clone()
 {
     return(new IndividualPropertiesCache(ParameterValuesCache.Clone(), AllCovariates));
 }
Exemple #19
0
 public PopulationSimulation()
 {
     ParameterValuesCache = new ParameterValuesCache();
     AgingData            = new AgingData();
     PKAnalyses           = new NullPopulationSimulationPKAnalyses();
 }
Exemple #20
0
 public virtual void Remove(string parameterPath)
 {
     ParameterValuesCache.Remove(parameterPath);
 }
Exemple #21
0
 public virtual void RemoveAdvancedParameter(AdvancedParameter advancedParameter)
 {
     advancedParameterCollection.RemoveAdvancedParameter(advancedParameter);
     ParameterValuesCache.Remove(advancedParameter.ParameterPath);
 }
Exemple #22
0
 public virtual bool Has(string parameterPath)
 {
     return(ParameterValuesCache.Has(parameterPath));
 }