Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/28/20 14:55:58 (5 years ago)
Author:
pfleck
Message:

#3040

  • Added full functional grammar for vectors.
  • Added sum and mean aggregation for vectors.
Location:
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
Files:
5 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/DataAnalysisGrammar.cs

    r17456 r17460  
    3535    protected DataAnalysisGrammar(string name, string description) : base(name, description) { }
    3636
    37     public void ConfigureVariableSymbols(IDataAnalysisProblemData problemData) {
     37    public virtual void ConfigureVariableSymbols(IDataAnalysisProblemData problemData) {
    3838      var dataset = problemData.Dataset;
    3939      foreach (var varSymbol in Symbols.OfType<VariableBase>()) {
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalVectorExpressionGrammar.cs

    r17456 r17460  
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     28using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>;
    2829
    2930namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    30   [StorableType("44B0829C-1CB5-4BE9-9514-BBA54FAB2912")]
    31   [Item("FullFunctionalExpressionGrammar", "Represents a grammar for functional expressions using all available functions.")]
    32   public class FullFunctionalExpressionGrammar : DataAnalysisGrammar, ISymbolicDataAnalysisGrammar {
     31  [StorableType("C913F5C6-AF16-4F2C-BA93-2D5AE1F8E68A")]
     32  [Item("FullFunctionalVectorExpressionGrammar", "Represents a grammar for functional expressions using all available functions.")]
     33  public class FullFunctionalVectorExpressionGrammar : DataAnalysisGrammar, ISymbolicDataAnalysisGrammar {
    3334    [StorableConstructor]
    34     protected FullFunctionalExpressionGrammar(StorableConstructorFlag _) : base(_) { }
    35     protected FullFunctionalExpressionGrammar(FullFunctionalExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
    36     public FullFunctionalExpressionGrammar()
    37       : base(ItemAttribute.GetName(typeof(FullFunctionalExpressionGrammar)), ItemAttribute.GetDescription(typeof(FullFunctionalExpressionGrammar))) {
     35    protected FullFunctionalVectorExpressionGrammar(StorableConstructorFlag _) : base(_) { }
     36    protected FullFunctionalVectorExpressionGrammar(FullFunctionalVectorExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
     37    public FullFunctionalVectorExpressionGrammar()
     38      : base(ItemAttribute.GetName(typeof(FullFunctionalVectorExpressionGrammar)), ItemAttribute.GetDescription(typeof(FullFunctionalVectorExpressionGrammar))) {
    3839      Initialize();
    3940    }
    4041
    4142    public override IDeepCloneable Clone(Cloner cloner) {
    42       return new FullFunctionalExpressionGrammar(this, cloner);
     43      return new FullFunctionalVectorExpressionGrammar(this, cloner);
    4344    }
    4445
     
    4849      var mul = new Multiplication();
    4950      var div = new Division();
    50       var aq = new AnalyticQuotient();
    51       var mean = new Average();
     51
    5252      var sin = new Sine();
    5353      var cos = new Cosine();
    5454      var tan = new Tangent();
     55
    5556      var log = new Logarithm();
    56       var abs = new Absolute();
    57       var tanh = new HyperbolicTangent();
    58       var pow = new Power();
    59       pow.InitialFrequency = 0.0;
    60       var square = new Square();
    61       square.InitialFrequency = 0.0;
    62       var cube = new Cube();
    63       cube.InitialFrequency = 0.0;
    64       var root = new Root();
    65       root.InitialFrequency = 0.0;
    66       var sqrt = new SquareRoot();
    67       sqrt.InitialFrequency = 0.0;
    68       var cubeRoot = new CubeRoot();
    69       cubeRoot.InitialFrequency = 0.0;
    70       var airyA = new AiryA();
    71       airyA.InitialFrequency = 0.0;
    72       var airyB = new AiryB();
    73       airyB.InitialFrequency = 0.0;
    74       var bessel = new Bessel();
    75       bessel.InitialFrequency = 0.0;
    76       var cosineIntegral = new CosineIntegral();
    77       cosineIntegral.InitialFrequency = 0.0;
    78       var dawson = new Dawson();
    79       dawson.InitialFrequency = 0.0;
    80       var erf = new Erf();
    81       erf.InitialFrequency = 0.0;
    82       var expIntegralEi = new ExponentialIntegralEi();
    83       expIntegralEi.InitialFrequency = 0.0;
    84       var fresnelCosineIntegral = new FresnelCosineIntegral();
    85       fresnelCosineIntegral.InitialFrequency = 0.0;
    86       var fresnelSineIntegral = new FresnelSineIntegral();
    87       fresnelSineIntegral.InitialFrequency = 0.0;
    88       var gamma = new Gamma();
    89       gamma.InitialFrequency = 0.0;
    90       var hypCosineIntegral = new HyperbolicCosineIntegral();
    91       hypCosineIntegral.InitialFrequency = 0.0;
    92       var hypSineIntegral = new HyperbolicSineIntegral();
    93       hypSineIntegral.InitialFrequency = 0.0;
    94       var norm = new Norm();
    95       norm.InitialFrequency = 0.0;
    96       var psi = new Psi();
    97       psi.InitialFrequency = 0.0;
    98       var sineIntegral = new SineIntegral();
    99       sineIntegral.InitialFrequency = 0.0;
     57      var exp = new Exponential();
    10058
    101       var exp = new Exponential();
    102       var @if = new IfThenElse();
    103       var gt = new GreaterThan();
    104       var lt = new LessThan();
    105       var and = new And();
    106       var or = new Or();
    107       var not = new Not();
    108       var xor = new Xor();
    10959
    110       var timeLag = new TimeLag();
    111       timeLag.InitialFrequency = 0.0;
    112       var integral = new Integral();
    113       integral.InitialFrequency = 0.0;
    114       var derivative = new Derivative();
    115       derivative.InitialFrequency = 0.0;
     60      var pow = new Power { InitialFrequency = 0.0 };
     61      var root = new Root { InitialFrequency = 0.0 };
     62      var square = new Square { InitialFrequency = 0.0 };
     63      var sqrt = new SquareRoot { InitialFrequency = 0.0 };
     64      var cube = new Cube { InitialFrequency = 0.0 };
     65      var cubeRoot = new CubeRoot { InitialFrequency = 0.0 };
    11666
    117       var variableCondition = new VariableCondition();
    118       variableCondition.InitialFrequency = 0.0;
    119 
    120       var constant = new Constant();
    121       constant.MinValue = -20;
    122       constant.MaxValue = 20;
    123       var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable();
     67      var constant = new Constant { MinValue = -20, MaxValue = 20 };
     68      var variable = new Variable();
    12469      var binFactorVariable = new BinaryFactorVariable();
    12570      var factorVariable = new FactorVariable();
    126       var laggedVariable = new LaggedVariable();
    127       laggedVariable.InitialFrequency = 0.0;
    128       var autoregressiveVariable = new AutoregressiveTargetVariable();
    129       autoregressiveVariable.InitialFrequency = 0.0;
    130       autoregressiveVariable.Enabled = false;
     71      var vectorVariable = new Variable() { Name = "Vector Variable" };
    13172
    132       var allSymbols = new List<Symbol>() { add, sub, mul, div, aq, mean, abs, sin, cos, tan, log, square, cube, pow, sqrt, cubeRoot, root, exp, tanh,
    133         airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral,
    134         @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, constant, variableSymbol, binFactorVariable, factorVariable, laggedVariable,autoregressiveVariable, variableCondition };
    135       var unaryFunctionSymbols = new List<Symbol>() { abs, square, sqrt, cube, cubeRoot, sin, cos, tan, log, exp, tanh, not, timeLag, integral, derivative,
    136         airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral
     73      var sum = new Sum();
     74      var mean = new Average() { Name = "Mean" };
     75
     76
     77      var allSymbols = new List<Symbol>() {
     78        add, sub, mul, div,
     79        sin, cos, tan,
     80        log, exp,
     81        square, sqrt, cube, cubeRoot, pow, root,
     82        constant, variable, binFactorVariable, factorVariable, vectorVariable,
     83        sum, mean
     84      };
     85      var unaryFunctionSymbols = new List<Symbol>() {
     86        sin, cos, tan,
     87        log, exp
    13788      };
    13889
    139       var binaryFunctionSymbols = new List<Symbol>() { pow, root, gt, lt, aq, variableCondition };
    140       var ternarySymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or, xor };
    141       var terminalSymbols = new List<Symbol>() { variableSymbol, binFactorVariable, factorVariable, constant, laggedVariable, autoregressiveVariable };
     90      var binaryFunctionSymbols = new List<Symbol>() { pow, root };
     91      var ternarySymbols = new List<Symbol>() { add, sub, mul, div };
     92      var terminalSymbols = new List<Symbol>() { variable, binFactorVariable, factorVariable, vectorVariable, constant };
     93
     94      var aggregationSymbols = new List<Symbol>() { sum, mean };
    14295
    14396      foreach (var symb in allSymbols)
     
    156109        SetSubtreeCount(terminalSymbol, 0, 0);
    157110      }
    158 
    159       SetSubtreeCount(@if, 3, 3);
     111      foreach (var aggrSymb in aggregationSymbols) {
     112        SetSubtreeCount(aggrSymb, 1, 1);
     113      }
    160114
    161115
     
    172126      }
    173127    }
     128
     129    public override void ConfigureVariableSymbols(IDataAnalysisProblemData problemData) {
     130      base.ConfigureVariableSymbols(problemData);
     131
     132      var dataset = problemData.Dataset;
     133      foreach (var varSymbol in Symbols.OfType<VariableBase>().Where(sym => sym.Name == "Variable")) {
     134        if (!varSymbol.Fixed) {
     135          varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<double>(x));
     136          varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<double>(x));
     137        }
     138      }
     139      foreach (var varSymbol in Symbols.OfType<VariableBase>().Where(sym => sym.Name == "Vector Variable")) {
     140        if (!varSymbol.Fixed) {
     141          varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<DoubleVector>(x));
     142          varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<DoubleVector>(x));
     143        }
     144      }
     145    }
    174146  }
    175147}
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs

    r17456 r17460  
    4242    private const string SpecialFunctionsName = "Special Functions";
    4343    private const string TimeSeriesSymbolsName = "Time Series Symbols";
    44     private const string VectorSymbolsName = "Vector Symbols";
    4544
    4645    [StorableConstructor]
     
    250249      Symbols.First(s => s.Name == ConditionalSymbolsName).Enabled = false;
    251250      Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = false;
    252       Symbols.First(s => s.Name == VectorSymbolsName).Enabled = false;
    253251    }
    254252
     
    264262      Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
    265263      Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = false;
    266       Symbols.First(s => s.Name == VectorSymbolsName).Enabled = false;
    267264    }
    268265
     
    275272      Symbols.First(s => s.Name == ConditionalSymbolsName).Enabled = false;
    276273      Symbols.First(s => s.Name == SpecialFunctionsName).Enabled = false;
    277       Symbols.First(s => s.Name == VectorSymbolsName).Enabled = false;
    278274
    279275      Symbols.Single(s => s.Name == "Variable").Enabled = false;
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentVectorExpressionGrammar.cs

    r17456 r17460  
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     28using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>;
     29
    2830namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    29   [StorableType("36A22322-0627-4E25-A468-F2A788AF6D46")]
    30   [Item("TypeCoherentExpressionGrammar", "Represents a grammar for functional expressions in which special syntactic constraints are enforced so that boolean and real-valued expressions are not mixed.")]
    31   public class TypeCoherentExpressionGrammar : DataAnalysisGrammar, ISymbolicDataAnalysisGrammar {
     31  [StorableType("7EC7B4A7-0E27-4011-B983-B0E15A6944EC")]
     32  [Item("TypeCoherentVectorExpressionGrammar", "Represents a grammar for functional expressions in which special syntactic constraints are enforced so that vector and scalar expressions are not mixed.")]
     33  public class TypeCoherentVectorExpressionGrammar : DataAnalysisGrammar, ISymbolicDataAnalysisGrammar {
    3234    private const string ArithmeticFunctionsName = "Arithmetic Functions";
    3335    private const string TrigonometricFunctionsName = "Trigonometric Functions";
     
    4244    private const string SpecialFunctionsName = "Special Functions";
    4345    private const string TimeSeriesSymbolsName = "Time Series Symbols";
    44     private const string VectorSymbolsName = "Vector Symbols";
    4546
    4647    [StorableConstructor]
    47     protected TypeCoherentExpressionGrammar(StorableConstructorFlag _) : base(_) { }
    48     protected TypeCoherentExpressionGrammar(TypeCoherentExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
    49     public TypeCoherentExpressionGrammar()
    50       : base(ItemAttribute.GetName(typeof(TypeCoherentExpressionGrammar)), ItemAttribute.GetDescription(typeof(TypeCoherentExpressionGrammar))) {
     48    protected TypeCoherentVectorExpressionGrammar(StorableConstructorFlag _) : base(_) { }
     49    protected TypeCoherentVectorExpressionGrammar(TypeCoherentVectorExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
     50    public TypeCoherentVectorExpressionGrammar()
     51      : base(ItemAttribute.GetName(typeof(TypeCoherentVectorExpressionGrammar)), ItemAttribute.GetDescription(typeof(TypeCoherentVectorExpressionGrammar))) {
    5152      Initialize();
    5253    }
    5354    public override IDeepCloneable Clone(Cloner cloner) {
    54       return new TypeCoherentExpressionGrammar(this, cloner);
     55      return new TypeCoherentVectorExpressionGrammar(this, cloner);
    5556    }
    5657
     
    241242    }
    242243
    243     public void ConfigureAsDefaultRegressionGrammar() {
    244       Symbols.First(s => s is Average).Enabled = false;
    245       Symbols.First(s => s is Absolute).Enabled = false;
    246       Symbols.First(s => s is HyperbolicTangent).Enabled = false;
    247       Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false;
    248       Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
    249       Symbols.First(s => s.Name == SpecialFunctionsName).Enabled = false;
    250       Symbols.First(s => s.Name == ConditionalSymbolsName).Enabled = false;
    251       Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = false;
    252       Symbols.First(s => s.Name == VectorSymbolsName).Enabled = false;
    253     }
    254 
    255     public void ConfigureAsDefaultClassificationGrammar() {
    256       Symbols.First(s => s is Average).Enabled = false;
    257       Symbols.First(s => s is VariableCondition).Enabled = false;
    258       Symbols.First(s => s is Xor).Enabled = false;
    259       Symbols.First(s => s is Absolute).Enabled = false;
    260       Symbols.First(s => s is HyperbolicTangent).Enabled = false;
    261       Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false;
    262       Symbols.First(s => s.Name == ExponentialFunctionsName).Enabled = false;
    263       Symbols.First(s => s.Name == SpecialFunctionsName).Enabled = false;
    264       Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
    265       Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = false;
    266       Symbols.First(s => s.Name == VectorSymbolsName).Enabled = false;
    267     }
    268 
    269     public void ConfigureAsDefaultTimeSeriesPrognosisGrammar() {
    270       Symbols.First(s => s is Average).Enabled = false;
    271       Symbols.First(s => s is Absolute).Enabled = false;
    272       Symbols.First(s => s is HyperbolicTangent).Enabled = false;
    273       Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false;
    274       Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
    275       Symbols.First(s => s.Name == ConditionalSymbolsName).Enabled = false;
    276       Symbols.First(s => s.Name == SpecialFunctionsName).Enabled = false;
    277       Symbols.First(s => s.Name == VectorSymbolsName).Enabled = false;
    278 
    279       Symbols.Single(s => s.Name == "Variable").Enabled = false;
    280       Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = true;
    281       Symbols.First(s => s is Derivative).Enabled = false;
    282       Symbols.First(s => s is Integral).Enabled = false;
    283       Symbols.First(s => s is TimeLag).Enabled = false;
     244    public override void ConfigureVariableSymbols(IDataAnalysisProblemData problemData) {
     245      base.ConfigureVariableSymbols(problemData);
     246
     247      var dataset = problemData.Dataset;
     248      foreach (var varSymbol in Symbols.OfType<VariableBase>().Where(sym => sym.Name == "Variable")) {
     249        if (!varSymbol.Fixed) {
     250          varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<double>(x));
     251          varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<double>(x));
     252        }
     253      }
     254      foreach (var varSymbol in Symbols.OfType<VariableBase>().Where(sym => sym.Name == "Vector Variable")) {
     255        if (!varSymbol.Fixed) {
     256          varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<DoubleVector>(x));
     257          varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<DoubleVector>(x));
     258        }
     259      }
    284260    }
    285261  }
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r17456 r17460  
    161161    <Compile Include="Formatters\SymbolicDataAnalysisExpressionCSharpFormatter.cs" />
    162162    <Compile Include="Grammars\DataAnalysisGrammar.cs" />
     163    <Compile Include="Grammars\FullFunctionalVectorExpressionGrammar.cs" />
     164    <Compile Include="Grammars\TypeCoherentVectorExpressionGrammar.cs" />
    163165    <Compile Include="Hashing\HashExtensions.cs" />
    164166    <Compile Include="Hashing\HashUtil.cs" />
     
    229231    <Compile Include="Symbols\And.cs" />
    230232    <Compile Include="Symbols\AutoregressiveVariable.cs" />
     233    <Compile Include="Symbols\Sum.cs" />
    231234    <Compile Include="Symbols\Average.cs" />
    232235    <Compile Include="Symbols\Constant.cs" />
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs

    r17455 r17460  
    7777    Cube = 50,
    7878    CubeRoot = 51,
    79     Tanh = 52
     79    Tanh = 52,
     80    Sum = 53
    8081  };
    8182  public static class OpCodes {
     
    133134    public const byte CubeRoot = (byte)OpCode.CubeRoot;
    134135    public const byte Tanh = (byte)OpCode.Tanh;
     136    public const byte Sum = (byte)OpCode.Sum;
    135137
    136138    private static Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() {
     
    187189      { typeof(AnalyticQuotient), OpCodes.AnalyticQuotient },
    188190      { typeof(Cube), OpCodes.Cube },
    189       { typeof(CubeRoot), OpCodes.CubeRoot }
     191      { typeof(CubeRoot), OpCodes.CubeRoot },
     192      { typeof(Sum), OpCodes.Sum }
    190193    };
    191194
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs

    r17455 r17460  
    118118        if (instr.opCode == OpCodes.Variable) {
    119119          var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
    120           instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
     120          if (dataset.VariableHasType<double>(variableTreeNode.VariableName))
     121            instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
     122          else if (dataset.VariableHasType<DoubleVector>(variableTreeNode.VariableName))
     123            instr.data = dataset.GetReadOnlyDoubleVectorValues(variableTreeNode.VariableName);
     124          else throw new NotSupportedException($"Type of variable {variableTreeNode.VariableName} is not supported.");
    121125        } else if (instr.opCode == OpCodes.FactorVariable) {
    122126          var factorTreeNode = instr.dynamicNode as FactorVariableTreeNode;
     
    186190      throw new NotSupportedException($"Unsupported argument type ({val})");
    187191    }
     192    private static EvaluationResult AggregateApply(EvaluationResult val,
     193      Func<double, double> sFunc = null,
     194      Func<DoubleVector, double> vFunc = null) {
     195      if (val.IsScalar && sFunc != null) return new EvaluationResult(sFunc(val.Scalar));
     196      if (val.IsVector && vFunc != null) return new EvaluationResult(vFunc(val.Vector));
     197      throw new NotSupportedException($"Unsupported argument type ({val})");
     198    }
    188199
    189200    public virtual EvaluationResult Evaluate(IDataset dataset, ref int row, InterpreterState state) {
     
    312323              v => DoubleVector.Log(v));
    313324          }
     325        case OpCodes.Sum: {
     326            var cur = Evaluate(dataset, ref row, state);
     327            return AggregateApply(cur,
     328              s => s,
     329              v => v.Sum());
     330          }
     331        case OpCodes.Average: {
     332            var cur = Evaluate(dataset, ref row, state);
     333            return AggregateApply(cur,
     334              s => s,
     335              v => v.Mean());
     336          }
    314337        case OpCodes.Variable: {
    315338            if (row < 0 || row >= dataset.Rows) return EvaluationResult.NaN;
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sum.cs

    r17455 r17460  
    2424using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2525using HEAL.Attic;
     26
    2627namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    27   [StorableType("459E521B-A921-4A0F-B63D-B298DA2CDD11")]
    28   [Item("Average", "Symbol that represents the average (arithmetic mean) function.")]
    29   public sealed class Average : Symbol {
     28  [StorableType("C6C245BF-C44A-4207-A268-55641483F27F")]
     29  [Item("Sum", "Symbol that represents the Sum function.")]
     30  public sealed class Sum : Symbol {
    3031    private const int minimumArity = 1;
    3132    private const int maximumArity = byte.MaxValue;
     
    3940
    4041    [StorableConstructor]
    41     private Average(StorableConstructorFlag _) : base(_) { }
    42     private Average(Average original, Cloner cloner) : base(original, cloner) { }
     42    private Sum(StorableConstructorFlag _) : base(_) { }
     43    private Sum(Sum original, Cloner cloner) : base(original, cloner) { }
    4344    public override IDeepCloneable Clone(Cloner cloner) {
    44       return new Average(this, cloner);
     45      return new Sum(this, cloner);
    4546    }
    46     public Average() : base("Average", "Symbol that represents the average (arithmetic mean) function.") { }
     47    public Sum() : base("Sum", "Symbol that represents the sum function.") { }
    4748  }
    4849}
Note: See TracChangeset for help on using the changeset viewer.