Changeset 4832 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encodings
- Timestamp:
- 11/18/10 11:07:45 (14 years ago)
- Location:
- branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encodings
- Files:
-
- 1 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encodings/IntValueParameterConfiguration.cs
r4830 r4832 12 12 public class IntValueParameterConfiguration : ValueTypeParameterConfiguration<IntValue> { 13 13 14 public IntValueParameterConfiguration(ParameterConfiguration parentConfiguration, string parameterName, I Item value) : base(parentConfiguration, parameterName, value) {14 public IntValueParameterConfiguration(ParameterConfiguration parentConfiguration, string parameterName, IValueParameter valueParameter) : base(parentConfiguration, parameterName, valueParameter) { 15 15 } 16 16 -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encodings/ParameterConfiguration.cs
r4830 r4832 46 46 } 47 47 48 public virtual IParameter Parameter { 49 get { 50 return parentConfiguration.GetChildParameter(this.parameterName); 51 } 48 //public virtual IParameter Parameter { 49 // get { 50 // return parentConfiguration.GetChildParameter(this.parameterName); 51 // } 52 //} 53 54 55 protected Type parameterType; 56 public Type ParameterType { 57 get { return this.parameterType; } 58 } 59 60 protected Type valueType; 61 public Type ValueType { 62 get { return this.valueType; } 52 63 } 53 64 … … 66 77 } 67 78 68 public ParameterConfiguration(ParameterConfiguration parentConfiguration, string parameterName, IItem value) { 79 // store parameter reference only for name/description/image/... 80 private IValueParameter parameter; 81 82 public ParameterConfiguration(ParameterConfiguration parentConfiguration, string parameterName, IValueParameter valueParameter) { 69 83 this.parentConfiguration = parentConfiguration; 70 84 this.ParameterName = parameterName; 71 this.Value = value; 85 this.Value = valueParameter.Value; 86 this.parameterType = valueParameter.GetType(); 87 this.valueType = valueParameter.DataType; 88 89 this.parameter = valueParameter; 72 90 } 73 91 … … 102 120 #region INamedItem Properties 103 121 public virtual string Name { 104 get { return Parameter .Name; }122 get { return ParameterName; } 105 123 set { throw new NotSupportedException(); } 106 124 } 107 125 public virtual string Description { 108 get { return Parameter.Description; }126 get { return parameter.Description; } 109 127 set { throw new NotSupportedException(); } 110 128 } … … 116 134 } 117 135 public virtual string ItemDescription { 118 get { return Parameter.ItemDescription; }136 get { return parameter.Description; } 119 137 } 120 138 public virtual System.Drawing.Image ItemImage { 121 get { return Parameter.ItemImage; }139 get { return parameter.ItemImage; } 122 140 } 123 141 public virtual string ItemName { 124 get { return Parameter.ItemName; }142 get { return parameter.ItemName; } 125 143 } 126 144 public virtual Version ItemVersion { 127 get { return Parameter.ItemVersion; }145 get { return parameter.ItemVersion; } 128 146 } 129 147 #endregion … … 192 210 193 211 if (typeof(IntValue).IsAssignableFrom(parameter.DataType)) { 194 return new IntValueParameterConfiguration(parentConfiguration, parameter.Name, valueParameter .Value);212 return new IntValueParameterConfiguration(parentConfiguration, parameter.Name, valueParameter); 195 213 } else if (typeof(IParameterizedItem).IsAssignableFrom(parameter.DataType)) { 196 return new ParameterConfiguration(parentConfiguration, parameter.Name, valueParameter .Value);214 return new ParameterConfiguration(parentConfiguration, parameter.Name, valueParameter); 197 215 } else { 198 216 // todo 199 return new IntValueParameterConfiguration(parentConfiguration, parameter.Name, valueParameter .Value);217 return new IntValueParameterConfiguration(parentConfiguration, parameter.Name, valueParameter); 200 218 } 201 219 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encodings/RootParameterConfiguration.cs
r4830 r4832 34 34 } 35 35 36 public override IParameter Parameter {37 get { return null; }38 }36 //public override IParameter Parameter { 37 // get { return null; } 38 //} 39 39 40 40 #region INamedItem Properties -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encodings/ValueTypeParameterConfiguration.cs
r4830 r4832 18 18 } 19 19 20 public ValueTypeParameterConfiguration(ParameterConfiguration parentConfiguration, string parameterName, I Item value) : base(parentConfiguration, parameterName, value) {20 public ValueTypeParameterConfiguration(ParameterConfiguration parentConfiguration, string parameterName, IValueParameter valueParameter) : base(parentConfiguration, parameterName, valueParameter) { 21 21 this.ranges = new ItemList<IRange<T>>(); 22 22 this.ranges.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IRange<T>>>(ranges_ItemsAdded);
Note: See TracChangeset
for help on using the changeset viewer.