Changeset 5207 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations
- Timestamp:
- 01/04/11 02:18:27 (14 years ago)
- Location:
- branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations/CheckedValueConfigurationCollection.cs
r5112 r5207 24 24 } 25 25 26 public CheckedValueConfigurationCollection(IItemSet<IItem> validValues) { 27 this.validValues = validValues; 26 public CheckedValueConfigurationCollection(IEnumerable<Type> validTypes) { 27 this.validValues = new ItemSet<IItem>(); 28 foreach (Type t in validTypes) { 29 this.validValues.Add((IItem)Activator.CreateInstance(t)); 30 } 28 31 RegisterEvents(); 29 32 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations/ValueConfiguration.cs
r5184 r5207 60 60 set { 61 61 if (this.actualValue != value) { 62 RegisterActualValueEvents();62 DeregisterActualValueEvents(); 63 63 ClearParameterConfigurations(); 64 64 this.actualValue = value; … … 66 66 OnValueChanged(); 67 67 OnToStringChanged(); 68 DeregisterActualValueEvents();68 RegisterActualValueEvents(); 69 69 } 70 70 } … … 87 87 public ValueConfiguration(IItem value, Type valueDataType) { 88 88 this.ParameterConfigurations = new ItemList<IParameterConfiguration>(); 89 var valid Values = new ItemSet<IItem>(ApplicationManager.Manager.GetInstances(valueDataType).Select(x => (IItem)x).OrderBy(x => x.ItemName));90 this.ActualValue = new ConstrainedValue(value, valueDataType, valid Values, false);89 var validTypes = ApplicationManager.Manager.GetTypes(valueDataType).OrderBy(x => x.Name).ToArray(); 90 this.ActualValue = new ConstrainedValue(value, valueDataType, validTypes, false); 91 91 this.IsOptimizable = true; 92 92 if (actualValue.ValueDataType == typeof(IntValue)) {
Note: See TracChangeset
for help on using the changeset viewer.