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); } }
public virtual IReadOnlyList <double> AllPercentilesFor(string parameterPath) { if (ParameterValuesCache.Has(parameterPath)) { return(ParameterValuesCache.PercentilesFor(parameterPath)); } return(Population.AllPercentilesFor(parameterPath)); }
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); } } }
public virtual bool Has(string parameterPath) { return(ParameterValuesCache.Has(parameterPath)); }