Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/29/18 09:07:03 (6 years ago)
Author:
jkarder
Message:

#2745: worked on EGO implementation

  • added parameter for initial sample set (only for D-EGO)
  • fixed project references and output paths
  • minor changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/SampleCollector.cs

    r15343 r15976  
    2020#endregion
    2121
     22using System.Collections.Generic;
     23using System.Linq;
    2224using HeuristicLab.Common;
    2325using HeuristicLab.Core;
     
    5860      if (data.Columns != vector.Length + 1) {
    5961        if (data.Columns != 0 || data.Rows != 0) throw new OperatorExecutionException(this, "dataset columns do not match samplesize+1");
    60         for (var i = 0; i < vector.Length; i++)
    61           data.AddVariable("input" + i, new double[0]);
    62         data.AddVariable("output", new double[0]);
     62        data = new ModifiableDataset(
     63          Enumerable.Range(0, vector.Length).Select(x => "input" + x).Concat(new[] { "output" }),
     64          Enumerable.Range(0, vector.Length + 1).Select(x => new List<double>()));
     65        DatasetParameter.ActualValue = data;
    6366      }
    6467      AddRow(data, vector, quality);
    65       return base.InstrumentedApply(); ;
     68      return base.InstrumentedApply();
    6669    }
    6770
Note: See TracChangeset for help on using the changeset viewer.