Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/05/12 11:11:56 (12 years ago)
Author:
jkarder
Message:

#1853:

  • extracted experiment generation from encoding
  • added creators
  • added crossovers
  • added manipulators
  • added support for parameters of type IFixedValueParameter
  • minor code improvements
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/ParameterConfigurations/ParameterConfiguration.cs

    r8535 r8574  
    573573        }
    574574      }
     575
    575576      var clonedValue = this.ActualValue.Value != null ? (IItem)this.ActualValue.Value.Clone() : null;
    576577      if (clonedValue != null) AdaptValidValues(parameter, clonedValue);
    577       parameter.Value = clonedValue;
     578
     579      if (!(parameter is IFixedValueParameter)) {
     580        parameter.Value = clonedValue;
     581      } else {
     582        var original = (dynamic)parameter.Value;
     583        var clone = (dynamic)clonedValue;
     584        if (typeof(ValueTypeValue<>).IsAssignableFrom(parameter.DataType) && !original.ReadOnly) {
     585          original.Value = clone.Value;
     586        } else if (typeof(ValueTypeArray<>).IsAssignableFrom(parameter.DataType) && !original.ReadOnly) {
     587          for (int i = 0; i < original.Length; i++)
     588            original[i] = clone[i];
     589        } else if (typeof(ValueTypeMatrix<>).IsAssignableFrom(parameter.DataType) && !original.ReadOnly) {
     590          for (int i = 0; i < original.Rows; i++)
     591            for (int j = 0; j < original.Columns; j++)
     592              original[i, j] = clone[i, j];
     593        } // StringConvertibleValueTuple<,> not supported
     594      }
    578595    }
    579596
Note: See TracChangeset for help on using the changeset viewer.