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)); }
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)); }
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 IEnumerable <string> AllParameterPaths() { return(ParameterValuesCache.AllParameterPaths()); }