Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2994-AutoDiffForIntervals/HeuristicLab.Algorithms.CMAEvolutionStrategy/3.4/CMAParameters.cs @ 17399

Last change on this file since 17399 was 17209, checked in by gkronber, 5 years ago

#2994: merged r17132:17198 from trunk to branch

File size: 4.6 KB
RevLine 
[9129]1#region License Information
2/* HeuristicLab
[17209]3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
[9129]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
[9709]22using System.Collections.Generic;
23using System.Linq;
[9129]24using HeuristicLab.Common;
25using HeuristicLab.Core;
[16565]26using HEAL.Attic;
[9129]27
28namespace HeuristicLab.Algorithms.CMAEvolutionStrategy {
29  [Item("CMAParameters", "CMA-ES controls many strategy parameters that guide the search and which are combined in this class.")]
[16565]30  [StorableType("FB7495E1-6285-4E3E-AEC3-F40CCB182F0F")]
[9709]31  public sealed class CMAParameters : Item {
[9129]32
[9709]33    [Storable(Name = "axisRatio")]
34    public double AxisRatio { get; set; }
35    [Storable(Name = "sigma")]
36    public double Sigma { get; set; }
37    [Storable(Name = "sigmaBounds")]
38    public double[,] SigmaBounds { get; set; }
39    [Storable(Name = "mu")]
40    public int Mu { get; set; }
41    [Storable(Name = "weights")]
42    public double[] Weights { get; set; }
43    [Storable(Name = "muEff")]
44    public double MuEff { get; set; }
45    [Storable(Name = "cc")]
46    public double CC { get; set; }
47    [Storable(Name = "cs")]
48    public double CS { get; set; }
49    [Storable(Name = "damps")]
50    public double Damps { get; set; }
51    [Storable(Name = "muCov")]
52    public double MuCov { get; set; }
53    [Storable(Name = "cCov")]
54    public double CCov { get; set; }
55    [Storable(Name = "cCovSep")]
56    public double CCovSep { get; set; }
57    [Storable(Name = "pc")]
58    public double[] PC { get; set; }
59    [Storable(Name = "ps")]
60    public double[] PS { get; set; }
61    [Storable(Name = "b")]
62    public double[,] B { get; set; }
63    [Storable(Name = "d")]
64    public double[] D { get; set; }
65    [Storable(Name = "c")]
66    public double[,] C { get; set; }
67    [Storable(Name = "bDz")]
68    public double[] BDz { get; set; }
69    [Storable(Name = "chiN")]
70    public double ChiN { get; set; }
71    [Storable(Name = "initialIterations")]
72    public int InitialIterations { get; set; }
[9200]73    [Storable(Name = "qualityHistory")]
74    private IEnumerable<double> StorableQualityHistory {
[9709]75      get { return QualityHistory ?? Enumerable.Empty<double>(); }
76      set { if (value != null) QualityHistory = new Queue<double>(value); }
[9200]77    }
[9709]78    public Queue<double> QualityHistory { get; set; }
79    [Storable(Name = "qualityHistorySize")]
80    public int QualityHistorySize { get; set; }
[9200]81
[9129]82    [StorableConstructor]
[16565]83    private CMAParameters(StorableConstructorFlag _) : base(_) { }
[9129]84    private CMAParameters(CMAParameters original, Cloner cloner)
85      : base(original, cloner) {
[9709]86      this.AxisRatio = original.AxisRatio;
87      if (original.B != null) this.B = (double[,])original.B.Clone();
88      if (original.BDz != null) this.BDz = (double[])original.BDz.Clone();
89      if (original.C != null) this.C = (double[,])original.C.Clone();
90      this.CCov = original.CCov;
91      this.CCovSep = original.CCovSep;
92      this.CC = original.CC;
93      this.ChiN = original.ChiN;
94      this.CS = original.CS;
95      if (original.D != null) this.D = (double[])original.D.Clone();
96      this.Damps = original.Damps;
97      this.InitialIterations = original.InitialIterations;
98      this.Mu = original.Mu;
99      this.MuCov = original.MuCov;
100      this.MuEff = original.MuEff;
101      if (original.PC != null) this.PC = (double[])original.PC.Clone();
102      if (original.PS != null) this.PS = (double[])original.PS.Clone();
103      this.Sigma = original.Sigma;
104      if (original.SigmaBounds != null) this.SigmaBounds = (double[,])original.SigmaBounds.Clone();
105      if (original.Weights != null) this.Weights = (double[])original.Weights.Clone();
[9129]106
[9709]107      if (original.QualityHistory != null) this.QualityHistory = new Queue<double>(original.QualityHistory);
108      this.QualityHistorySize = original.QualityHistorySize;
[9129]109    }
110    public CMAParameters() { }
111
112    public override IDeepCloneable Clone(Cloner cloner) {
113      return new CMAParameters(this, cloner);
114    }
115  }
116}
Note: See TracBrowser for help on using the repository browser.