Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/14/22 08:33:46 (2 years ago)
Author:
mkommend
Message:

#3136:

  • Added handling of numeric parameters in structur GP problem by using a real vector encoding.
  • Configured grammar in sub function.
  • Added property for numeric parameters in structure template.
Location:
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/StructureTemplate.cs

    r18191 r18194  
    6161      get => tree;
    6262      private set {
     63        containsNumericParameters = null;
    6364        tree = value;
    6465
     
    6869        // adds new functions and keeps the old ones (if they match)
    6970        subFunctions = newFunctions.Except(oldFunctions).Concat(oldFunctions).ToList();
     71      }
     72    }
     73
     74    private bool? containsNumericParameters;
     75    public bool ContainsNumericParameters {
     76      get {
     77        if (!containsNumericParameters.HasValue)
     78          containsNumericParameters = Tree.IterateNodesPrefix().OfType<NumberTreeNode>().Any();
     79
     80        return containsNumericParameters.Value;
    7081      }
    7182    }
  • branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/SubFunction.cs

    r18184 r18194  
    7575    #region Event Handling
    7676    private void RegisterEventHandlers() {
    77       GrammarParameter.ValueChanged += OnParameterValueChanged;
     77      GrammarParameter.ValueChanged += (o, e) => {
     78        if (Grammar is TypeCoherentExpressionGrammar tceg) tceg.ConfigureAsDefaultRegressionGrammar();
     79        OnParameterValueChanged(o, e);
     80      };
    7881      MaximumSymbolicExpressionTreeDepthParameter.Value.ValueChanged += OnParameterValueChanged;
    7982      MaximumSymbolicExpressionTreeLengthParameter.Value.ValueChanged += OnParameterValueChanged;
Note: See TracChangeset for help on using the changeset viewer.