Changeset 4832


Ignore:
Timestamp:
11/18/10 11:07:45 (8 years ago)
Author:
cneumuel
Message:

#1215 worked on metaoptimization

Location:
branches/HeuristicLab.MetaOptimization
Files:
2 added
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueView.cs

    r4830 r4832  
    3535      var typeSelectorDialog = new TypeSelectorDialog();
    3636      typeSelectorDialog.Caption = "Select Value";
    37       typeSelectorDialog.TypeSelector.Configure(Content.Parameter.DataType, false, true);
     37      typeSelectorDialog.TypeSelector.Configure(Content.ValueType, false, true);
    3838
    3939      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encodings/IntValueParameterConfiguration.cs

    r4830 r4832  
    1212  public class IntValueParameterConfiguration : ValueTypeParameterConfiguration<IntValue> {
    1313
    14     public IntValueParameterConfiguration(ParameterConfiguration parentConfiguration, string parameterName, IItem value) : base(parentConfiguration, parameterName, value) {
     14    public IntValueParameterConfiguration(ParameterConfiguration parentConfiguration, string parameterName, IValueParameter valueParameter) : base(parentConfiguration, parameterName, valueParameter) {
    1515    }
    1616
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encodings/ParameterConfiguration.cs

    r4830 r4832  
    4646    }
    4747
    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; }
    5263    }
    5364
     
    6677    }
    6778
    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) {
    6983      this.parentConfiguration = parentConfiguration;
    7084      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;
    7290    }
    7391
     
    102120    #region INamedItem Properties
    103121    public virtual string Name {
    104       get { return Parameter.Name; }
     122      get { return ParameterName; }
    105123      set { throw new NotSupportedException(); }
    106124    }
    107125    public virtual string Description {
    108       get { return Parameter.Description; }
     126      get { return parameter.Description; }
    109127      set { throw new NotSupportedException(); }
    110128    }
     
    116134    }
    117135    public virtual string ItemDescription {
    118       get { return Parameter.ItemDescription; }
     136      get { return parameter.Description; }
    119137    }
    120138    public virtual System.Drawing.Image ItemImage {
    121       get { return Parameter.ItemImage; }
     139      get { return parameter.ItemImage; }
    122140    }
    123141    public virtual string ItemName {
    124       get { return Parameter.ItemName; }
     142      get { return parameter.ItemName; }
    125143    }
    126144    public virtual Version ItemVersion {
    127       get { return Parameter.ItemVersion; }
     145      get { return parameter.ItemVersion; }
    128146    }
    129147    #endregion
     
    192210
    193211        if (typeof(IntValue).IsAssignableFrom(parameter.DataType)) {
    194           return new IntValueParameterConfiguration(parentConfiguration, parameter.Name, valueParameter.Value);
     212          return new IntValueParameterConfiguration(parentConfiguration, parameter.Name, valueParameter);
    195213        } else if (typeof(IParameterizedItem).IsAssignableFrom(parameter.DataType)) {
    196           return new ParameterConfiguration(parentConfiguration, parameter.Name, valueParameter.Value);
     214          return new ParameterConfiguration(parentConfiguration, parameter.Name, valueParameter);
    197215        } else {
    198216          // todo
    199           return new IntValueParameterConfiguration(parentConfiguration, parameter.Name, valueParameter.Value);
     217          return new IntValueParameterConfiguration(parentConfiguration, parameter.Name, valueParameter);
    200218        }
    201219      }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encodings/RootParameterConfiguration.cs

    r4830 r4832  
    3434    }
    3535
    36     public override IParameter Parameter {
    37       get { return null; }
    38     }
     36    //public override IParameter Parameter {
     37    //  get { return null; }
     38    //}
    3939
    4040    #region INamedItem Properties
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encodings/ValueTypeParameterConfiguration.cs

    r4830 r4832  
    1818    }
    1919
    20     public ValueTypeParameterConfiguration(ParameterConfiguration parentConfiguration, string parameterName, IItem value) : base(parentConfiguration, parameterName, value) {
     20    public ValueTypeParameterConfiguration(ParameterConfiguration parentConfiguration, string parameterName, IValueParameter valueParameter) : base(parentConfiguration, parameterName, valueParameter) {
    2121      this.ranges = new ItemList<IRange<T>>();
    2222      this.ranges.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IRange<T>>>(ranges_ItemsAdded);
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/HeuristicLab.Problems.MetaOptimization-3.3.csproj

    r4830 r4832  
    8787  </ItemGroup>
    8888  <ItemGroup>
    89     <Compile Include="Analyzers\BestQualityAnalyzer.cs" />
     89    <Compile Include="Analyzers\BestParameterConfigurationAnalyzer.cs" />
    9090    <Compile Include="Interfaces\IParameterConfigurationCreator.cs" />
    9191    <Compile Include="Creators\RandomParameterConfigurationCreator.cs" />
    92     <Compile Include="Encodings\Crossovers\ParameterVectorCrossover.cs" />
     92    <Compile Include="Encodings\Crossovers\ParameterConfigurationCrossover.cs" />
    9393    <Compile Include="Encodings\IntValueParameterConfiguration.cs" />
    9494    <Compile Include="Encodings\ValueTypeParameterConfiguration.cs">
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Interfaces/IParameterConfiguration.cs

    r4830 r4832  
    99    bool OptimizationEnabled { get; set; }
    1010    string ParameterName { get; set; }
    11     IParameter Parameter { get; }
     11    //IParameter Parameter { get; }
     12    Type ParameterType { get; }
     13    Type ValueType { get; }
    1214    IItem Value { get; set; }
    1315    IItemList<IParameterConfiguration> ChildParameterConfigurations { get; }
Note: See TracChangeset for help on using the changeset viewer.