Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/17/11 11:03:48 (14 years ago)
Author:
cneumuel
Message:

#1215

  • fixed import of existing algorithm
  • moved operators in subfolders
  • extended tests for SymbolicExpressionGrammar
File:
1 edited

Legend:

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

    r5927 r6017  
    138138    protected IItemSet<IItem> validValues;
    139139
     140    [Storable]
     141    private bool autoPopulateValueConfigurations = true;
     142    public bool AutoPopulateValueConfigurations {
     143      get { return autoPopulateValueConfigurations; }
     144      set { autoPopulateValueConfigurations = value; }
     145    }
     146   
     147
    140148    #region Constructors and Cloning
    141149    public ParameterConfiguration(string parameterName, IValueParameter valueParameter, bool discoverValidValues) {
     150      this.AutoPopulateValueConfigurations = true;
    142151      this.ParameterName = parameterName;
    143152      this.parameterDataType = valueParameter.GetType();
     
    162171    }
    163172    public ParameterConfiguration(string parameterName, Type type, IItem actualValue, IEnumerable<IValueConfiguration> valueConfigurations) {
     173      this.AutoPopulateValueConfigurations = false;
    164174      this.ParameterName = parameterName;
    165175      this.parameterDataType = type;
     
    174184    }
    175185    public ParameterConfiguration(string parameterName, Type type, IItem actualValue) {
     186      this.AutoPopulateValueConfigurations = true;
    176187      this.ParameterName = parameterName;
    177188      this.parameterDataType = type;
     
    206217      this.discoverValidValues = original.discoverValidValues;
    207218      if (this.valueConfigurations != null) RegisterValueConfigurationEvents();
     219      this.AutoPopulateValueConfigurations = original.AutoPopulateValueConfigurations;
    208220    }
    209221
     
    238250
    239251    protected virtual void PopulateValueConfigurations() {
     252      if (!this.AutoPopulateValueConfigurations)
     253        return;
     254
    240255      foreach (Type t in this.validTypes) {
    241256        if (t == typeof(NullValue)) {
     
    266281
    267282    protected virtual void ClearValueConfigurations() {
     283      if (!this.AutoPopulateValueConfigurations)
     284        return;
     285
    268286      this.ValueConfigurations.Clear();
    269287    }
Note: See TracChangeset for help on using the changeset viewer.