Changeset 14833 for branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/EgoUtilities.cs
- Timestamp:
- 04/07/17 09:34:44 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/EgoUtilities.cs
r14818 r14833 25 25 using System.Threading; 26 26 using HeuristicLab.Common; 27 using HeuristicLab.Core;28 27 using HeuristicLab.Data; 29 28 using HeuristicLab.Encodings.RealVectorEncoding; … … 76 75 if (ex != null) throw ex; 77 76 return alg.Results; 78 }79 public static RealVector[] GetUniformRandomDesign(int points, int dim, DoubleMatrix bounds, IRandom random) {80 var res = new RealVector[points];81 for (var i = 0; i < points; i++) {82 var r = new RealVector(dim);83 res[i] = r;84 for (var j = 0; j < dim; j++) {85 var b = j % bounds.Rows;86 r[j] = UniformRandom(bounds[b, 0], bounds[b, 1], random);87 }88 }89 return res;90 }91 public static double UniformRandom(double min, double max, IRandom rand) {92 return rand.NextDouble() * (max - min) + min;93 77 } 94 78
Note: See TracChangeset
for help on using the changeset viewer.