Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encodings/RootParameterConfiguration.cs @ 4830

Last change on this file since 4830 was 4830, checked in by cneumuel, 13 years ago

#1215 worked on metaoptimization

File size: 2.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
6using HeuristicLab.Core;
7using HeuristicLab.Common;
8
9namespace HeuristicLab.Problems.MetaOptimization {
10  /// <summary>
11  /// This class does not have a ParameterName, because its the root element of the ParameterConfiguration-Tree
12  /// It only deals with child-ParameterConfigurations
13  /// </summary>
14  [StorableClass]
15  public class RootParameterConfiguration : ParameterConfiguration {
16
17    public new IParameterizedNamedItem Value {
18      get { return (IParameterizedNamedItem)base.Value; }
19      set { base.Value = value; }
20    }
21
22    public RootParameterConfiguration(IParameterizedNamedItem rootItem) {
23      this.OptimizationEnabled = true;
24      this.Value = rootItem;
25    }
26
27    public RootParameterConfiguration() { }
28    [StorableConstructor]
29    protected RootParameterConfiguration(bool deserializing) { }
30    protected RootParameterConfiguration(RootParameterConfiguration original, Cloner cloner) : base(original, cloner) {
31    }
32    public override IDeepCloneable Clone(Cloner cloner) {
33      return new RootParameterConfiguration(this, cloner);
34    }
35
36    public override IParameter Parameter {
37      get { return null; }
38    }
39
40    #region INamedItem Properties
41    public override string Name {
42      get { return Value.Name; }
43      set { throw new NotSupportedException(); }
44    }
45    public override string Description {
46      get { return Value.Description; }
47      set { throw new NotSupportedException(); }
48    }
49    public override bool CanChangeDescription {
50      get { return false; }
51    }
52    public override bool CanChangeName {
53      get { return false; }
54    }
55    public override string ItemDescription {
56      get { return Value.ItemDescription; }
57    }
58    public override System.Drawing.Image ItemImage {
59      get { return Value.ItemImage; }
60    }
61    public override string ItemName {
62      get { return Value.ItemName; }
63    }
64    public override Version ItemVersion {
65      get { return Value.ItemVersion; }
66    }
67    #endregion
68  }
69}
Note: See TracBrowser for help on using the repository browser.