Пример #1
0
        public ParameterSpaceGrid(ParameterSet defaults, double[] increments, int[] decrement_count, int[] increment_count)
        {
            AxesList = new List <ParameterAxis>();
            ParameterNameToAxisIndex = new Dictionary <string, int>();
            for (int parameter_index = 0; parameter_index < defaults.ParameterValues.Count; parameter_index++)
            {
                ParameterValue     default_value = defaults.ParameterValues[parameter_index];
                ParameterIncrement increment     = new ParameterIncrement(increments[parameter_index], IncrementType.Linear);
                ParameterValue     min_value     = increment.DecrementValue(default_value, decrement_count[parameter_index]);

                AxesList.Add(new ParameterAxis(
                                 min_value,
                                 increment,
                                 decrement_count[parameter_index] + increment_count[parameter_index] + 1,
                                 decrement_count[parameter_index]
                                 ));
                ParameterNameToAxisIndex[default_value.Name] = parameter_index;
            }

            Size = 1;
            foreach (ParameterAxis axis in AxesList)
            {
                Size *= axis.Size;
            }
        }
Пример #2
0
        public ParameterAxis(ParameterValue min_value, ParameterIncrement increment, int axis_count, int default_index)
        {
            this.MinValue   = min_value;
            ValuesToIndexes = new Dictionary <ParameterValue, int>();

            List <ParameterValue> temp_list = new List <ParameterValue>();

            temp_list.Add(min_value);
            ValuesToIndexes.Add(min_value, 0);
            for (int index = 1; index < axis_count; index++)
            {
                temp_list.Add(increment.IncrementValue(temp_list.Last()));
                ValuesToIndexes.Add(temp_list.Last(), index);
            }
            this.ValueList    = temp_list;
            this.DefaultValue = ValueList[default_index];
        }