Changeset 12740


Ignore:
Timestamp:
07/11/15 19:44:35 (6 years ago)
Author:
abeham
Message:

#2301: merged 12292,12293 to stable

Location:
stable
Files:
37 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Common/3.3/HeuristicLab.Common-3.3.csproj

    r11920 r12740  
    143143    <Compile Include="Plugin.cs" />
    144144    <Compile Include="ReferenceEqualityComparer.cs" />
     145    <Compile Include="SequenceGenerator.cs" />
    145146    <Compile Include="TimeSpanHelper.cs" />
    146147    <Compile Include="TypeEqualityComparer.cs" />
  • stable/HeuristicLab.MainForm.WindowsForms/3.3/Dialogs/DefineArithmeticProgressionDialog.cs

    r12009 r12740  
    2323using System.ComponentModel;
    2424using System.Globalization;
    25 using System.Linq;
    2625using System.Windows.Forms;
    2726using HeuristicLab.Common;
     
    3130    private bool allowOnlyInteger;
    3231
    33     public double Minimum { get; private set; }
    34     public double Maximum { get; private set; }
    35     public double Step { get; private set; }
     32    public decimal Minimum { get; private set; }
     33    public decimal Maximum { get; private set; }
     34    public decimal Step { get; private set; }
    3635
    37     public IEnumerable<double> Values {
    38       get { return EnumerateProgression().Reverse(); }
     36    public IEnumerable<decimal> Values {
     37      get { return SequenceGenerator.GenerateSteps(Minimum, Maximum, Step, includeEnd: true); }
    3938    }
    4039
     
    4847      this.allowOnlyInteger = allowOnlyInteger;
    4948    }
    50     public DefineArithmeticProgressionDialog(bool allowOnlyInteger, double minimum, double maximum, double step)
     49    public DefineArithmeticProgressionDialog(bool allowOnlyInteger, decimal minimum, decimal maximum, decimal step)
    5150      : this(allowOnlyInteger) {
    5251      Minimum = minimum;
     
    6362    private void textBox_Validating(object sender, CancelEventArgs e) {
    6463      var textBox = (TextBox)sender;
    65       double value = 0;
     64      decimal value = 0;
    6665      if (allowOnlyInteger) {
    6766        int intValue;
     
    7574        }
    7675      } else {
    77         if (!double.TryParse(textBox.Text, NumberStyles.Float, CultureInfo.CurrentCulture.NumberFormat, out value)) {
     76        if (!decimal.TryParse(textBox.Text, NumberStyles.Float, CultureInfo.CurrentCulture.NumberFormat, out value)) {
    7877          errorProvider.SetError(textBox, "Please enter a valid double value.");
    7978          e.Cancel = true;
     
    9089      return Minimum <= Maximum && Step >= 0;
    9190    }
    92 
    93     private IEnumerable<double> EnumerateProgression() {
    94       double value = Maximum;
    95       bool minimumIncluded = false;
    96       int i = 1;
    97       while (value >= Minimum) {
    98         if (value.IsAlmost(Minimum)) {
    99           yield return Minimum;
    100           minimumIncluded = true;
    101         } else yield return value;
    102 
    103         if (Step == 0) break; // a step size of 0 will only output maximum and minimum
    104         if (allowOnlyInteger) {
    105           value = (int)Maximum - i * (int)Step;
    106         } else {
    107           value = Maximum - i * Step;
    108         }
    109         i++;
    110       }
    111       if (!minimumIncluded) {
    112         yield return Minimum;
    113       }
    114     }
    11591  }
    11692}
  • stable/HeuristicLab.Optimizer

  • stable/HeuristicLab.Optimizer/3.3/CreateExperimentDialog.cs

    r12009 r12740  
    264264      var parameter = (IValueParameter)generateButton.Tag;
    265265      bool integerOnly = intParameters.ContainsKey(parameter);
    266       double min = 0, max = 1, step = 1;
     266      decimal min = 0, max = 1, step = 1;
    267267      #region Try to calculate some meaningful values
    268268      if (integerOnly) {
     
    276276        int len = doubleParameters[parameter].Length;
    277277        if (len > 0) {
    278           min = doubleParameters[parameter].Min();
    279           max = doubleParameters[parameter].Max();
    280           step = len >= 2 ? Math.Abs((doubleParameters[parameter][len - 1] - doubleParameters[parameter][len - 2])) : 1;
     278          min = (decimal)doubleParameters[parameter].Min();
     279          max = (decimal)doubleParameters[parameter].Max();
     280          step = len >= 2 ? Math.Abs(((decimal)doubleParameters[parameter][len - 1] - (decimal)doubleParameters[parameter][len - 2])) : 1m;
    281281        }
    282282      }
     
    292292          } else {
    293293            doubleParameters[parameter].Reset -= new EventHandler(ValuesArray_Reset);
    294             doubleParameters[parameter] = new DoubleArray(values.ToArray());
     294            doubleParameters[parameter] = new DoubleArray(values.Select(x => (double)x).ToArray());
    295295            doubleParameters[parameter].Reset += new EventHandler(ValuesArray_Reset);
    296296            stringConvertibleArrayView.Content = doubleParameters[parameter];
  • stable/HeuristicLab.Problems.Instances.DataAnalysis

  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionEight.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       data.Add(ValueGenerator.GenerateSteps(0m, 100, 1).Select(v => (double)v).ToList());
    51       data[0].AddRange(ValueGenerator.GenerateSteps(0m, 100, 0.1m).Select(v => (double)v));
     51      data.Add(SequenceGenerator.GenerateSteps(0m, 100, 1).Select(v => (double)v).ToList());
     52      data[0].AddRange(SequenceGenerator.GenerateSteps(0m, 100, 0.1m).Select(v => (double)v));
    5253
    5354      double x;
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionEleven.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950    protected override List<List<double>> GenerateValues() {
    5051      List<List<double>> data = new List<List<double>>();
    51       List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();
     52      List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();
    5253      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5354
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFifteen.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();
     51      List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();
    5152      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5253
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFour.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950    protected override List<List<double>> GenerateValues() {
    5051      List<List<double>> data = new List<List<double>>();
    51       data.Add(ValueGenerator.GenerateSteps(0, 10, 0.05m).Select(v => (double)v).ToList());
    52       data[0].AddRange(ValueGenerator.GenerateSteps(0.05m, 10.05m, 0.05m).Select(v => (double)v));
     52      data.Add(SequenceGenerator.GenerateSteps(0, 10, 0.05m).Select(v => (double)v).ToList());
     53      data[0].AddRange(SequenceGenerator.GenerateSteps(0.05m, 10.05m, 0.05m).Select(v => (double)v));
    5354
    5455      double x;
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFourteen.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double) v).ToList();
     51      List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double) v).ToList();
    5152      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5253
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionNine.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       data.Add(ValueGenerator.GenerateSteps(0m, 100, 1).Select(v => (double)v).ToList());
    51       data[0].AddRange(ValueGenerator.GenerateSteps(0, 100, 0.1m).Select(v => (double)v));
     51      data.Add(SequenceGenerator.GenerateSteps(0m, 100, 1).Select(v => (double)v).ToList());
     52      data[0].AddRange(SequenceGenerator.GenerateSteps(0, 100, 0.1m).Select(v => (double)v));
    5253
    5354      double x;
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionOne.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       data.Add(ValueGenerator.GenerateSteps(-1, 1, 0.1m).Select(v => (double)v).ToList());
    51       data[0].AddRange(ValueGenerator.GenerateSteps(-1, 1, 0.001m).Select(v => (double)v));
     51      data.Add(SequenceGenerator.GenerateSteps(-1, 1, 0.1m).Select(v => (double)v).ToList());
     52      data[0].AddRange(SequenceGenerator.GenerateSteps(-1, 1, 0.001m).Select(v => (double)v));
    5253
    5354      double x;
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionSeven.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950    protected override List<List<double>> GenerateValues() {
    5051      List<List<double>> data = new List<List<double>>();
    51       data.Add(ValueGenerator.GenerateSteps(1m, 100, 1).Select(v => (double)v).ToList());
    52       data[0].AddRange(ValueGenerator.GenerateSteps(1m, 100, 0.1m).Select(v => (double)v));
     52      data.Add(SequenceGenerator.GenerateSteps(1m, 100, 1).Select(v => (double)v).ToList());
     53      data[0].AddRange(SequenceGenerator.GenerateSteps(1m, 100, 0.1m).Select(v => (double)v));
    5354
    5455      double x;
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionSix.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       data.Add(ValueGenerator.GenerateSteps(1m, 50, 1).Select(v => (double)v).ToList());
    51       data[0].AddRange(ValueGenerator.GenerateSteps(1m, 120, 1).Select(v => (double)v));
     51      data.Add(SequenceGenerator.GenerateSteps(1m, 50, 1).Select(v => (double)v).ToList());
     52      data[0].AddRange(SequenceGenerator.GenerateSteps(1m, 120, 1).Select(v => (double)v));
    5253
    5354      double x;
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTen.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950      List<List<double>> data = new List<List<double>>();
    5051
    51       List<double> oneVariableTestData = ValueGenerator.GenerateSteps(0, 1, 0.01m).Select(v => (double)v).ToList();
     52      List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(0, 1, 0.01m).Select(v => (double)v).ToList();
    5253      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5354
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionThirteen.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();
     51      List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();
    5152      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5253
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionThree.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       data.Add(ValueGenerator.GenerateSteps(-3, 3, 0.1m).Select(v => (double)v).ToList());
    51       data[0].AddRange(ValueGenerator.GenerateSteps(-3, 3, 0.001m).Select(v => (double)v));
     51      data.Add(SequenceGenerator.GenerateSteps(-3, 3, 0.1m).Select(v => (double)v).ToList());
     52      data[0].AddRange(SequenceGenerator.GenerateSteps(-3, 3, 0.001m).Select(v => (double)v));
    5253
    5354      double x;
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTwelve.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();
     51      List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();
    5152      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5253
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTwo.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       data.Add(ValueGenerator.GenerateSteps(-2, 2, 0.1m).Select(v => (double)v).ToList());
    51       data[0].AddRange(ValueGenerator.GenerateSteps(-2, 2, 0.001m).Select(v => (double)v));
     51      data.Add(SequenceGenerator.GenerateSteps(-2, 2, 0.1m).Select(v => (double)v).ToList());
     52      data[0].AddRange(SequenceGenerator.GenerateSteps(-2, 2, 0.001m).Select(v => (double)v));
    5253
    5354      double x;
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/ValueGenerator.cs

    r12009 r12740  
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    2423using System.Linq;
    25 using HeuristicLab.Common;
    2624using HeuristicLab.Random;
    2725
    2826namespace HeuristicLab.Problems.Instances.DataAnalysis {
    29   public static class ValueGenerator {
     27  internal static class ValueGenerator {
    3028    private static FastRandom rand = new FastRandom();
    31 
    32     /// <summary>
    33     /// Generates a sequence of evenly spaced points by returning the start value and adding the stepwidth until the end is reached or surpassed.
    34     ///
    35     /// </summary>
    36     /// <param name="start">The smallest and first value of the sequence.</param>
    37     /// <param name="end">The largest and last value of the sequence.</param>
    38     /// <param name="stepWidth">The step size between subsequent values.</param>
    39     /// <param name="includeEnd">Determines if the end should be included in the sequence regardless if the end is divisible by the stepwidth.</param>
    40     /// <returns>A sequence of values from start to end (inclusive)</returns>
    41     [Obsolete("It is recommended to use the decimal overload to achieve a higher numerical accuracy.")]
    42     public static IEnumerable<double> GenerateSteps(double start, double end, double stepWidth, bool includeEnd = false) {
    43       //mkommend: IEnumerable.Cast fails due to boxing and unboxing of the involved types
    44       // http://referencesource.microsoft.com/#System.Core/System/Linq/Enumerable.cs#27bb217a6d5457ec
    45       // http://blogs.msdn.com/b/ericlippert/archive/2009/03/19/representation-and-identity.aspx     
    46 
    47       return GenerateSteps((decimal)start, (decimal)end, (decimal)stepWidth, includeEnd).Select(x => (double)x);
    48     }
    49 
    50     /// <summary>
    51     /// Generates a sequence of evenly spaced points by returning the start value and adding the stepwidth until the end is reached or surpassed.
    52     /// </summary>
    53     /// <param name="start">The smallest and first value of the sequence.</param>
    54     /// <param name="end">The largest and last value of the sequence.</param>
    55     /// <param name="stepWidth">The step size between subsequent values.</param>
    56     /// /// <param name="includeEnd">Determines if the end should be included in the sequence regardless if the end is divisible by the stepwidth.</param>
    57     /// <returns>A sequence of values from start to end</returns>
    58     public static IEnumerable<decimal> GenerateSteps(decimal start, decimal end, decimal stepWidth, bool includeEnd = false) {
    59       if (stepWidth == 0)
    60         throw new ArgumentException("The step width cannot be zero.");
    61       if (start < end && stepWidth < 0)
    62         throw new ArgumentException("The step width must be larger than zero for increasing sequences (start < end).");
    63       if (start > end && stepWidth > 0)
    64         throw new ArgumentException("The step width must be smaller than zero for decreasing sequences (start > end).");
    65 
    66       decimal x = start;
    67       while (x <= end) {
    68         yield return x;
    69         x += stepWidth;
    70       }
    71       if (x - stepWidth < end && includeEnd) yield return end;
    72     }
    7329
    7430    /// <summary>
     
    10056    }
    10157
    102     // iterative approach
     58    // Generate the cartesian product.
     59    // The result is transposed, therefore the inner lists represent a column of values instead of a combination-pair.
    10360    public static IEnumerable<IEnumerable<double>> GenerateAllCombinationsOfValuesInLists(List<List<double>> lists) {
    10461      List<List<double>> allCombinations = new List<List<double>>();
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Various/SpatialCoevolution.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    5354      List<List<double>> data = new List<List<double>>();
    5455
    55       List<double> evenlySpacedSequence = ValueGenerator.GenerateSteps(-5, 5, 0.4m).Select(v => (double)v).ToList();
     56      List<double> evenlySpacedSequence = SequenceGenerator.GenerateSteps(-5, 5, 0.4m).Select(v => (double)v).ToList();
    5657      List<List<double>> trainingData = new List<List<double>>() { evenlySpacedSequence, evenlySpacedSequence };
    5758      var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(trainingData).ToList();
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/KotanchekFunction.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950      List<List<double>> data = new List<List<double>>();
    5051
    51       List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-0.2m, 4.2m, 0.1m).Select(v => (double)v).ToList();
     52      List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-0.2m, 4.2m, 0.1m).Select(v => (double)v).ToList();
    5253      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5354      var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList<IEnumerable<double>>();
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/RationalPolynomialThreeDimensional.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4445    protected override int TrainingPartitionEnd { get { return 300; } }
    4546    protected override int TestPartitionStart { get { return 300; } }
    46     protected override int TestPartitionEnd { get { return 300 + (15*12*15); } }
     47    protected override int TestPartitionEnd { get { return 300 + (15 * 12 * 15); } }
    4748
    4849    protected override List<List<double>> GenerateValues() {
     
    5556
    5657      List<List<double>> testData = new List<List<double>>() {
    57         ValueGenerator.GenerateSteps(-0.05m, 2.05m, 0.15m).Select(v => (double)v).ToList(),
    58         ValueGenerator.GenerateSteps( 0.95m, 2.05m, 0.1m).Select(v => (double)v).ToList(),
    59         ValueGenerator.GenerateSteps(-0.05m, 2.05m, 0.15m).Select(v => (double)v).ToList()
     58        SequenceGenerator.GenerateSteps(-0.05m, 2.05m, 0.15m).Select(v => (double)v).ToList(),
     59        SequenceGenerator.GenerateSteps( 0.95m, 2.05m, 0.1m).Select(v => (double)v).ToList(),
     60        SequenceGenerator.GenerateSteps(-0.05m, 2.05m, 0.15m).Select(v => (double)v).ToList()
    6061      };
    6162
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/RationalPolynomialTwoDimensional.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950      List<List<double>> data = new List<List<double>>();
    5051
    51       List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-0.25m, 6.35m, 0.2m).Select(v => (double)v).ToList();
     52      List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-0.25m, 6.35m, 0.2m).Select(v => (double)v).ToList();
    5253
    5354      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SalutowiczFunctionOneDimensional.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       data.Add(ValueGenerator.GenerateSteps(0.05m, 10, 0.1m).Select(v => (double)v).ToList());
    51       data[0].AddRange(ValueGenerator.GenerateSteps(-0.5m, 10.5m, 0.05m).Select(v => (double)v));
     51      data.Add(SequenceGenerator.GenerateSteps(0.05m, 10, 0.1m).Select(v => (double)v).ToList());
     52      data[0].AddRange(SequenceGenerator.GenerateSteps(-0.5m, 10.5m, 0.05m).Select(v => (double)v));
    5253
    5354      double x;
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SalutowiczFunctionTwoDimensional.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950      List<List<double>> data = new List<List<double>>();
    5051      List<List<double>> trainingData = new List<List<double>>() {
    51         ValueGenerator.GenerateSteps(0.05m, 10, 0.1m).Select(v => (double)v).ToList(),
    52         ValueGenerator.GenerateSteps(0.05m, 10.05m, 2).Select(v => (double)v).ToList()
     52        SequenceGenerator.GenerateSteps(0.05m, 10, 0.1m).Select(v => (double)v).ToList(),
     53        SequenceGenerator.GenerateSteps(0.05m, 10.05m, 2).Select(v => (double)v).ToList()
    5354      };
    5455
    5556      List<List<double>> testData = new List<List<double>>() {
    56         ValueGenerator.GenerateSteps(-0.5m, 10.5m, 0.05m).Select(v => (double)v).ToList(),
    57         ValueGenerator.GenerateSteps(-0.5m, 10.5m, 0.5m).Select(v => (double)v).ToList()
     57        SequenceGenerator.GenerateSteps(-0.5m, 10.5m, 0.05m).Select(v => (double)v).ToList(),
     58        SequenceGenerator.GenerateSteps(-0.5m, 10.5m, 0.5m).Select(v => (double)v).ToList()
    5859      };
    5960
  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SineCosineFunction.cs

    r12009 r12740  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      List<List<double>> data = new List<List<double>>();
    50       List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-0.05m, 6.05m, 0.02m).Select(v => (double)v).ToList();
     51      List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-0.05m, 6.05m, 0.02m).Select(v => (double)v).ToList();
    5152      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5253      var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList<IEnumerable<double>>();
  • stable/HeuristicLab.Tests

  • stable/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchRFClassificationScriptSource.cs

    r11907 r12740  
    44
    55using HeuristicLab.Algorithms.DataAnalysis;
     6using HeuristicLab.Common;
    67using HeuristicLab.Problems.DataAnalysis;
    7 using HeuristicLab.Problems.Instances.DataAnalysis;
    88using HeuristicLab.Scripting;
    99
     
    2929  */
    3030  static Dictionary<string, IEnumerable<double>> randomForestParameterRanges = new Dictionary<string, IEnumerable<double>> {
    31     { "N", ValueGenerator.GenerateSteps(5m, 10, 1).Select(x => Math.Pow(2,(double)x)) },
    32     { "R", ValueGenerator.GenerateSteps(0.05m, 0.66m, 0.05m).Select(x => (double)x) },
    33     { "M", ValueGenerator.GenerateSteps(0.1m, 1, 0.1m).Select(x => (double)x) }
     31    { "N", SequenceGenerator.GenerateSteps(5m, 10, 1).Select(x => Math.Pow(2,(double)x)) },
     32    { "R", SequenceGenerator.GenerateSteps(0.05m, 0.66m, 0.05m).Select(x => (double)x) },
     33    { "M", SequenceGenerator.GenerateSteps(0.1m, 1, 0.1m).Select(x => (double)x) }
    3434  };
    3535
  • stable/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchRFRegressionScriptSource.cs

    r11907 r12740  
    44
    55using HeuristicLab.Algorithms.DataAnalysis;
     6using HeuristicLab.Common;
    67using HeuristicLab.Problems.DataAnalysis;
    7 using HeuristicLab.Problems.Instances.DataAnalysis;
    88using HeuristicLab.Random;
    99using HeuristicLab.Scripting;
     
    3030  */
    3131  static Dictionary<string, IEnumerable<double>> randomForestParameterRanges = new Dictionary<string, IEnumerable<double>> {
    32     { "N", ValueGenerator.GenerateSteps(5m, 10, 1).Select(x => Math.Pow(2,(double)x)) },
    33     { "R", ValueGenerator.GenerateSteps(0.05m, 0.66m, 0.05m).Select(x => (double)x) },
    34     { "M", ValueGenerator.GenerateSteps(0.1m, 1, 0.1m).Select(x => (double)x) }
     32    { "N", SequenceGenerator.GenerateSteps(5m, 10, 1).Select(x => Math.Pow(2,(double)x)) },
     33    { "R", SequenceGenerator.GenerateSteps(0.05m, 0.66m, 0.05m).Select(x => (double)x) },
     34    { "M", SequenceGenerator.GenerateSteps(0.1m, 1, 0.1m).Select(x => (double)x) }
    3535  };
    3636
  • stable/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchSVMClassificationScriptSource.cs

    r11789 r12740  
    55
    66using HeuristicLab.Algorithms.DataAnalysis;
     7using HeuristicLab.Common;
    78using HeuristicLab.Core;
    89using HeuristicLab.Data;
    910using HeuristicLab.Parameters;
    1011using HeuristicLab.Problems.DataAnalysis;
    11 using HeuristicLab.Problems.Instances.DataAnalysis;
    1212using HeuristicLab.Scripting;
    1313
     
    3838        { "svm_type", new List<double> {svm_parameter.NU_SVC } },
    3939        { "kernel_type", new List<double> { svm_parameter.RBF }},
    40         { "C", ValueGenerator.GenerateSteps(-1m, 10, 1).Select(x => Math.Pow(2,(double)x)) },
    41         { "gamma", ValueGenerator.GenerateSteps(-4m, -1, 1).Select(x => Math.Pow(2,(double)x)) },
    42 //        { "eps", ValueGenerator.GenerateSteps(-8m, -1, 1).Select(x => Math.Pow(2, (double)x)) },
    43         { "nu" , ValueGenerator.GenerateSteps(-10m, 0, 1m).Select(x => Math.Pow(2, (double)x)) },
    44 //        { "degree", ValueGenerator.GenerateSteps(1m, 4, 1).Select(x => (double)x) }
     40        { "C", SequenceGenerator.GenerateSteps(-1m, 10, 1).Select(x => Math.Pow(2,(double)x)) },
     41        { "gamma", SequenceGenerator.GenerateSteps(-4m, -1, 1).Select(x => Math.Pow(2,(double)x)) },
     42//        { "eps", SequenceGenerator.GenerateSteps(-8m, -1, 1).Select(x => Math.Pow(2, (double)x)) },
     43        { "nu" , SequenceGenerator.GenerateSteps(-10m, 0, 1m).Select(x => Math.Pow(2, (double)x)) },
     44//        { "degree", SequenceGenerator.GenerateSteps(1m, 4, 1).Select(x => (double)x) }
    4545  };
    4646
  • stable/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchSVMRegressionScriptSource.cs

    r11789 r12740  
    55
    66using HeuristicLab.Algorithms.DataAnalysis;
     7using HeuristicLab.Common;
    78using HeuristicLab.Core;
    89using HeuristicLab.Data;
    910using HeuristicLab.Parameters;
    1011using HeuristicLab.Problems.DataAnalysis;
    11 using HeuristicLab.Problems.Instances.DataAnalysis;
    1212using HeuristicLab.Scripting;
    1313
     
    3838        { "svm_type", new List<double> {svm_parameter.NU_SVR } },
    3939        { "kernel_type", new List<double> { svm_parameter.RBF }},
    40         { "C", ValueGenerator.GenerateSteps(-1m, 12, 1).Select(x => Math.Pow(2, (double)x)) },
    41         { "gamma", ValueGenerator.GenerateSteps(-4m, -1, 1).Select(x => Math.Pow(2, (double)x)) },
    42 //        { "eps", ValueGenerator.GenerateSteps(-8m, -1, 1).Select(x => Math.Pow(2, (double)x)) },
    43         { "nu" , ValueGenerator.GenerateSteps(-10m, 0, 1m).Select(x => Math.Pow(2, (double)x)) },
    44 //        { "degree", ValueGenerator.GenerateSteps(1m, 4, 1).Select(x => (double)x) }
     40        { "C", SequenceGenerator.GenerateSteps(-1m, 12, 1).Select(x => Math.Pow(2, (double)x)) },
     41        { "gamma", SequenceGenerator.GenerateSteps(-4m, -1, 1).Select(x => Math.Pow(2, (double)x)) },
     42//        { "eps", SequenceGenerator.GenerateSteps(-8m, -1, 1).Select(x => Math.Pow(2, (double)x)) },
     43        { "nu" , SequenceGenerator.GenerateSteps(-10m, 0, 1m).Select(x => Math.Pow(2, (double)x)) },
     44//        { "degree", SequenceGenerator.GenerateSteps(1m, 4, 1).Select(x => (double)x) }
    4545  };
    4646
Note: See TracChangeset for help on using the changeset viewer.