Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/24/11 10:12:39 (13 years ago)
Author:
cneumuel
Message:

#1215

  • minor bugfixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs

    r5359 r5361  
    146146      this.ValueConfigurations = new CheckedValueConfigurationList(this.validValues ?? CreateValidValues());
    147147      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
    149149        valueParameter.DataType,
    150150        this.validValues != null ? new ItemSet<IItem>(this.validValues) : CreateValidValues(),
     
    200200      if (this.ActualValue != null) this.ActualValue.ToStringChanged -= new EventHandler(ActualValue_ToStringChanged);
    201201    }
    202 
     202   
    203203    private void PopulateValueConfigurations() {
    204204      foreach (Type t in this.validTypes) {
     
    370370        if (this.Optimize) {
    371371          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())) {
    373375            // 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()));
    375377          } else {
    376378            // 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.