Changeset 13403 for branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Multinormal.cs
- Timestamp:
- 11/25/15 23:24:01 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions
- Files:
-
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Multinormal.cs
r13393 r13403 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 using HeuristicLab.Random; 32 33 33 34 namespace HeuristicLab.Problems.TestFunctions.Evaluators { 34 [Item("Multinormal Function", "Evaluates a random multinormal function on a given point.")]35 [Item("Multinormal", "Evaluates a random multinormal function on a given point.")] 35 36 [StorableClass] 36 public class MultinormalEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 37 public override string FunctionName { get { return "Multinormal"; } } 37 public class Multinormal : SingleObjectiveTestFunction { 38 38 39 39 private ItemList<RealVector> centers { … … 45 45 set { Parameters["s^2s"].ActualValue = value; } 46 46 } 47 private static System.Random Random = new System.Random(); 47 48 public IRandom Random { 49 get { return ((ValueParameter<IRandom>)Parameters["Random"]).Value; } 50 set { ((ValueParameter<IRandom>)Parameters["Random"]).Value = value; } 51 } 48 52 49 53 private Dictionary<int, List<RealVector>> stdCenters; … … 87 91 88 92 [StorableConstructor] 89 protected Multinormal Evaluator(bool deserializing) : base(deserializing) { }90 protected Multinormal Evaluator(MultinormalEvaluatororiginal, Cloner cloner) : base(original, cloner) { }91 public Multinormal Evaluator() {93 protected Multinormal(bool deserializing) : base(deserializing) { } 94 protected Multinormal(Multinormal original, Cloner cloner) : base(original, cloner) { } 95 public Multinormal() { 92 96 Parameters.Add(new ValueParameter<ItemList<RealVector>>("Centers", "Centers of normal distributions")); 93 97 Parameters.Add(new ValueParameter<RealVector>("s^2s", "sigma^2 of normal distributions")); 94 Parameters.Add(new LookupParameter<IRandom>("Random", "Random number generator"));98 Parameters.Add(new ValueParameter<IRandom>("Random", "The random number generator that will make random instances", new MersenneTwister(0))); 95 99 centers = new ItemList<RealVector>(); 96 100 s_2s = new RealVector(); … … 98 102 99 103 public override IDeepCloneable Clone(Cloner cloner) { 100 return new Multinormal Evaluator(this, cloner);104 return new Multinormal(this, cloner); 101 105 } 102 106
Note: See TracChangeset
for help on using the changeset viewer.