Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/20/21 14:39:46 (3 years ago)
Author:
dpiringe
Message:

#3136

  • added linear scaling logic in Evaluate and (for UI reasons) Analyze
  • added logic forSubFunctionSymbol (modified OpCodes) -> the SubFunctionTreeNode is display in the tree but has no effect on evaluation (works like a flag)
    • works now with SymbolicDataAnalysisExpressionTreeInterpreter
  • default grammar for SubFunction is now ArithmeticExpressionGrammar instead of LinearScalingGrammar
Location:
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
Files:
4 edited

Legend:

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

    r17963 r18071  
    7979    CubeRoot = 51,
    8080    Tanh = 52,
     81    SubFunction = 53
    8182  };
    8283  public static class OpCodes {
     
    134135    public const byte CubeRoot = (byte)OpCode.CubeRoot;
    135136    public const byte Tanh = (byte)OpCode.Tanh;
    136 
     137    public const byte SubFunction = (byte)OpCode.SubFunction;
    137138
    138139    private static Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() {
    139        { typeof(Addition), OpCodes.Add },
     140      { typeof(Addition), OpCodes.Add },
    140141      { typeof(Subtraction), OpCodes.Sub },
    141142      { typeof(Multiplication), OpCodes.Mul },
     
    189190      { typeof(AnalyticQuotient), OpCodes.AnalyticQuotient },
    190191      { typeof(Cube), OpCodes.Cube },
    191       { typeof(CubeRoot), OpCodes.CubeRoot }
     192      { typeof(CubeRoot), OpCodes.CubeRoot },
     193      { typeof(SubFunctionSymbol), OpCodes.SubFunction }
    192194    };
    193195
  • branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs

    r17180 r18071  
    528528            }
    529529          }
     530        case OpCodes.SubFunction: {
     531            return Evaluate(dataset, ref row, state);
     532          }
    530533        default:
    531534          throw new NotSupportedException();
  • branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/StructureTemplate.cs

    r18069 r18071  
    4646      set {
    4747        applyLinearScaling = value;
    48         //subFunctions = GetSubFunctions();
    4948        OnChanged();
    5049      }
  • branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/SubFunction.cs

    r18069 r18071  
    5252    #region Constructors
    5353    public SubFunction() {
    54       Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(GrammarParameterName, new LinearScalingGrammar()));
    55       Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, new IntValue(10)));
    56       Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, new IntValue(30)));
     54      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(GrammarParameterName, new ArithmeticExpressionGrammar()));
     55      Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, new IntValue(8)));
     56      Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, new IntValue(20)));
    5757
    58       // TODO: separate events for each parameter
    5958      GrammarParameter.ValueChanged += OnParameterValueChanged;
    6059      MaximumSymbolicExpressionTreeDepthParameter.Value.ValueChanged += OnParameterValueChanged;
Note: See TracChangeset for help on using the changeset viewer.