Changeset 14818 for branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/InfillCriteria/InfillCriterionBase.cs
- Timestamp:
- 04/04/17 12:37:52 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/InfillCriteria/InfillCriterionBase.cs
r14741 r14818 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Encodings.RealVectorEncoding; 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 26 using HeuristicLab.Problems.DataAnalysis; 26 27 27 28 // ReSharper disable once CheckNamespace 28 29 namespace HeuristicLab.Algorithms.EGO { 29 30 [StorableClass] 30 31 public abstract class InfillCriterionBase : ParameterizedNamedItem, IInfillCriterion { 31 32 33 [Storable] 34 protected IRegressionSolution RegressionSolution; 35 [Storable] 36 protected bool ExpensiveMaximization; 37 [Storable] 38 protected RealVectorEncoding Encoding; 39 32 40 protected InfillCriterionBase(bool deserializing) : base(deserializing) { } 33 protected InfillCriterionBase(InfillCriterionBase original, Cloner cloner) : base(original, cloner) { } 41 42 protected InfillCriterionBase(InfillCriterionBase original, Cloner cloner) : base(original, cloner) { 43 RegressionSolution = cloner.Clone(original.RegressionSolution); 44 ExpensiveMaximization = original.ExpensiveMaximization; 45 Encoding = cloner.Clone(original.Encoding); 46 } 34 47 protected InfillCriterionBase() { } 35 48 36 public abstract double Evaluate(IRegressionSolution model, RealVector vector, bool maximization); 37 public virtual bool Maximization(bool expensiveProblemMaximization) { 38 return expensiveProblemMaximization; 49 public abstract double Evaluate(RealVector vector); 50 public abstract bool Maximization(); 51 52 public void Initialize(IRegressionSolution solution, bool expensiveMaximization, RealVectorEncoding encoding) { 53 RegressionSolution = solution; 54 ExpensiveMaximization = expensiveMaximization; 55 Encoding = encoding; 56 Initialize(); 39 57 } 58 59 protected abstract void Initialize(); 60 40 61 } 41 62 }
Note: See TracChangeset
for help on using the changeset viewer.