Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/21/10 01:13:49 (13 years ago)
Author:
cneumuel
Message:

#1215

  • added possibility to create all parameter combinations from a ParameterConfigurationTree and generate an experiment from them
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations/ValueConfiguration.cs

    r5112 r5144  
    99using HeuristicLab.Encodings.IntegerVectorEncoding;
    1010using HeuristicLab.PluginInfrastructure;
     11using System.Collections.Generic;
     12using System.Text;
    1113
    1214namespace HeuristicLab.Problems.MetaOptimization {
     
    8991      this.IsOptimizable = true;
    9092      if (actualValue.ValueDataType == typeof(IntValue)) {
    91         rangeConstraint = new IntValueRange(new IntValue(0), (IntValue)value, new IntValue(1));
     93        RangeConstraint = new IntValueRange(new IntValue(0), (IntValue)value, new IntValue(1));
    9294      } else if (actualValue.ValueDataType == typeof(DoubleValue)) {
    93         rangeConstraint = new DoubleValueRange(new DoubleValue(0), (DoubleValue)value, new DoubleValue(0.01));
     95        RangeConstraint = new DoubleValueRange(new DoubleValue(0), (DoubleValue)value, new DoubleValue(0.01));
    9496      } else if (actualValue.ValueDataType == typeof(PercentValue)) {
    95         rangeConstraint = new PercentValueRange(new PercentValue(0), new PercentValue(1), new PercentValue(0.001));
     97        RangeConstraint = new PercentValueRange(new PercentValue(0), new PercentValue(1), new PercentValue(0.001));
    9698      } else if (actualValue.ValueDataType == typeof(BoolValue)) {
    9799        this.IsOptimizable = false; // there is nothing to configure for bools
    98100      } else {
    99         rangeConstraint = null;
    100       }
    101       RegisterRangeConstraintEvents();
     101        RangeConstraint = null;
     102      }
    102103    }
    103104
     
    155156    }
    156157    #endregion
    157    
     158
    158159    #region IItem Members
    159160    public override string ItemDescription {
     
    169170    }
    170171    #endregion
    171    
     172
    172173    #region Event Handlers
    173174    public virtual event EventHandler ValueChanged;
     
    208209        return base.ToString();
    209210      }
     211    }
     212
     213    public string ToParameterInfoString() {
     214      StringBuilder sb = new StringBuilder();
     215      if (this.Optimize) {
     216        if (this.ParameterConfigurations.Count > 0) {
     217          var parameterInfos = new List<string>();
     218          foreach (var pc in this.ParameterConfigurations) {
     219            if (pc.Optimize) parameterInfos.Add(pc.ToParameterInfoString());
     220          }
     221          sb.Append(string.Join(", ", parameterInfos.ToArray()));
     222        }
     223      }
     224      return sb.ToString();
    210225    }
    211226
Note: See TracChangeset for help on using the changeset viewer.