Exemplo n.º 1
0
        public bool computeDesign(int distinctValuesPerOption)
        {
            Dictionary <NumericOption, double> centerPoints = computeCenterPoint();

            Dictionary <NumericOption, List <double> > values = new Dictionary <NumericOption, List <double> >();

            this.selectedConfigurations.Add(centerPoints);

            foreach (NumericOption vf in this.options)
            {
                //Getting values for learning the variable feature
                List <double> valuesOneOption = ExperimentalDesign.sampleOption(vf, (int)Math.Min(distinctValuesPerOption - 1, vf.getNumberOfSteps()), true);
                if (valuesOneOption.Contains(vf.getCenterValue()))
                {
                    valuesOneOption = ExperimentalDesign.sampleOption(vf, (int)Math.Min(distinctValuesPerOption, vf.getNumberOfSteps()), true);
                    valuesOneOption.Remove(vf.getCenterValue());
                }

                foreach (double currValue in valuesOneOption)
                {
                    Dictionary <NumericOption, double> oneSample = new Dictionary <NumericOption, double>();
                    oneSample.Add(vf, currValue);
                    foreach (NumericOption other in this.options)
                    {
                        if (other.Equals(vf))
                        {
                            continue;
                        }
                        oneSample.Add(other, centerPoints[other]);
                    }
                    this.selectedConfigurations.Add(oneSample);
                }
            }
            return(true);
        }