예제 #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));
        }
예제 #2
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));
        }
예제 #3
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);
                }
            }
        }
예제 #4
0
 public virtual IEnumerable <string> AllParameterPaths()
 {
     return(ParameterValuesCache.AllParameterPaths());
 }