Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/04/17 12:37:52 (8 years ago)
Author:
bwerth
Message:

#2745 added several new InfillCriteria and moved Parameters from the InfillProblem to the Criteria themselves; added Sanitiy checks for GaussianProcessRegression

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/InfillCriteria/InfillCriterionBase.cs

    r14741 r14818  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Encodings.RealVectorEncoding;
     25using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2526using HeuristicLab.Problems.DataAnalysis;
    2627
    2728// ReSharper disable once CheckNamespace
    2829namespace HeuristicLab.Algorithms.EGO {
    29 
     30  [StorableClass]
    3031  public abstract class InfillCriterionBase : ParameterizedNamedItem, IInfillCriterion {
    3132
     33    [Storable]
     34    protected IRegressionSolution RegressionSolution;
     35    [Storable]
     36    protected bool ExpensiveMaximization;
     37    [Storable]
     38    protected RealVectorEncoding Encoding;
     39
    3240    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    }
    3447    protected InfillCriterionBase() { }
    3548
    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();
    3957    }
     58
     59    protected abstract void Initialize();
     60
    4061  }
    4162}
Note: See TracChangeset for help on using the changeset viewer.