Changeset 5361 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations
- Timestamp:
- 01/24/11 10:12:39 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs
r5359 r5361 146 146 this.ValueConfigurations = new CheckedValueConfigurationList(this.validValues ?? CreateValidValues()); 147 147 this.ActualValue = new ConstrainedValue( 148 valueParameter.Value != null ? (IItem)valueParameter.Value.Clone() : null,148 valueParameter.Value != null ? valueParameter.Value : null, // don't clone here; otherwise settings of a non-optimized ValueParameter will not be synchronized with the ConstrainedValue 149 149 valueParameter.DataType, 150 150 this.validValues != null ? new ItemSet<IItem>(this.validValues) : CreateValidValues(), … … 200 200 if (this.ActualValue != null) this.ActualValue.ToStringChanged -= new EventHandler(ActualValue_ToStringChanged); 201 201 } 202 202 203 203 private void PopulateValueConfigurations() { 204 204 foreach (Type t in this.validTypes) { … … 370 370 if (this.Optimize) { 371 371 var vc = this.ValueConfigurations[actualValueConfigurationIndex]; 372 if (IsSubclassOfRawGeneric(typeof(ValueTypeValue<>), vc.GetType())) { 372 if (vc.ActualValue == null || vc.ActualValue.Value == null) { 373 sb.Append(string.Format("{0}: null", parameterName)); 374 } else if (IsSubclassOfRawGeneric(typeof(ValueTypeValue<>), vc.ActualValue.Value.GetType())) { 373 375 // for int, double, bool use the value directly 374 sb.Append(string.Format("{0}: {1}", parameterName, this.ActualValue.Value != null ? this.ActualValue.Value.ToString() : "null"));376 sb.Append(string.Format("{0}: {1}", parameterName, this.ActualValue.Value.ToString())); 375 377 } else { 376 378 // for other types use NumberedName (this also uses the Number-Property for otherwise ambiguous ValueConfigurations)
Note: See TracChangeset
for help on using the changeset viewer.