Changeset 15976 for branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteSampleCollector.cs
- Timestamp:
- 06/29/18 09:07:03 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteSampleCollector.cs
r15343 r15976 20 20 #endregion 21 21 22 using System.Collections.Generic; 23 using System.Linq; 22 24 using HeuristicLab.Common; 23 25 using HeuristicLab.Core; … … 59 61 if (data.Columns != vector.Length + 1) { 60 62 if (data.Columns != 0 || data.Rows != 0) throw new OperatorExecutionException(this, "dataset columns do not match samplesize+1"); 61 for (var i = 0; i < vector.Length; i++)62 data.AddVariable("input" + i, new double[0]);63 data .AddVariable("output", new double[0]);64 } 65 AddRow(data, vector, quality); 66 return base.InstrumentedApply(); ;63 var variableNames = vector.Select((x, i) => string.Format("input" + i)).Concat("output".ToEnumerable()); 64 var variableValues = vector.Select(x => (double)x).Concat(quality.ToEnumerable()).Select(x => new List<double> { x }); 65 data = DatasetParameter.ActualValue = new ModifiableDataset(variableNames, variableValues); 66 } else AddRow(data, vector, quality); 67 68 return base.InstrumentedApply(); 67 69 } 68 70
Note: See TracChangeset
for help on using the changeset viewer.