1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using HeuristicLab.Common;
|
---|
23 | using HeuristicLab.Core;
|
---|
24 | using HeuristicLab.Data;
|
---|
25 | using HeuristicLab.Parameters;
|
---|
26 | using HEAL.Attic;
|
---|
27 |
|
---|
28 | namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
|
---|
29 | /// <summary>
|
---|
30 | /// Abstract base class for multi objective symbolic data analysis analyzers.
|
---|
31 | /// </summary>
|
---|
32 | [StorableType("C9896773-7A11-4D68-86EC-DB04AE075637")]
|
---|
33 | public abstract class SymbolicDataAnalysisMultiObjectiveAnalyzer : SymbolicDataAnalysisAnalyzer, ISymbolicDataAnalysisMultiObjectiveAnalyzer {
|
---|
34 | private const string QualitiesParameterName = "Qualities";
|
---|
35 | private const string MaximizationParameterName = "Maximization";
|
---|
36 | private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
|
---|
37 | #region parameter properties
|
---|
38 | public IScopeTreeLookupParameter<DoubleArray> QualitiesParameter {
|
---|
39 | get { return (IScopeTreeLookupParameter<DoubleArray>)Parameters[QualitiesParameterName]; }
|
---|
40 | }
|
---|
41 | public ILookupParameter<BoolArray> MaximizationParameter {
|
---|
42 | get { return (ILookupParameter<BoolArray>)Parameters[MaximizationParameterName]; }
|
---|
43 | }
|
---|
44 | public ILookupParameter<BoolValue> ApplyLinearScalingParameter {
|
---|
45 | get { return (ILookupParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
|
---|
46 | }
|
---|
47 | #endregion
|
---|
48 | #region properties
|
---|
49 | public ItemArray<DoubleArray> Qualities {
|
---|
50 | get { return QualitiesParameter.ActualValue; }
|
---|
51 | }
|
---|
52 | public BoolArray Maximization {
|
---|
53 | get { return MaximizationParameter.ActualValue; }
|
---|
54 | }
|
---|
55 | #endregion
|
---|
56 | [StorableConstructor]
|
---|
57 | protected SymbolicDataAnalysisMultiObjectiveAnalyzer(StorableConstructorFlag _) : base(_) { }
|
---|
58 | protected SymbolicDataAnalysisMultiObjectiveAnalyzer(SymbolicDataAnalysisMultiObjectiveAnalyzer original, Cloner cloner)
|
---|
59 | : base(original, cloner) {
|
---|
60 | }
|
---|
61 | public SymbolicDataAnalysisMultiObjectiveAnalyzer()
|
---|
62 | : base() {
|
---|
63 | Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>(QualitiesParameterName, "The qualities of the trees that should be analyzed."));
|
---|
64 | Parameters.Add(new LookupParameter<BoolArray>(MaximizationParameterName, "The directions of optimization for each dimension."));
|
---|
65 | Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the individual should be linearly scaled before evaluating."));
|
---|
66 | }
|
---|
67 |
|
---|
68 | [StorableHook(HookType.AfterDeserialization)]
|
---|
69 | private void AfterDeserialization() {
|
---|
70 | if (Parameters.ContainsKey(ApplyLinearScalingParameterName) && Parameters[ApplyLinearScalingParameterName] is LookupParameter<BoolValue>)
|
---|
71 | Parameters.Remove(ApplyLinearScalingParameterName);
|
---|
72 | if (!Parameters.ContainsKey(ApplyLinearScalingParameterName))
|
---|
73 | Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the individual should be linearly scaled before evaluating."));
|
---|
74 | }
|
---|
75 | }
|
---|
76 | }
|
---|