Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/30/10 10:04:03 (14 years ago)
Author:
gkronber
Message:

Merged changesets from revisions r4249, r4250, r4251, r4291, r4295 from trunk into data analysis exploration #1142.

Location:
branches/DataAnalysis
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis

  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ArithmeticExpressionGrammar.cs

    r4068 r4341  
    3030  [Item("ArithmeticExpressionGrammar", "Represents a grammar for functional expressions using only arithmetic operations.")]
    3131  public class ArithmeticExpressionGrammar : DefaultSymbolicExpressionGrammar {
    32     [Storable]
    33     private HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable variableSymbol;
    34 
    3532    public ArithmeticExpressionGrammar()
    3633      : base() {
     
    4946      constant.MinValue = -20;
    5047      constant.MaxValue = 20;
    51       variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable();
     48      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable();
    5249
    5350      var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, variableSymbol };
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs

    r4068 r4341  
    3030  [Item("FullFunctionalExpressionGrammar", "Represents a grammar for functional expressions using all available functions.")]
    3131  public class FullFunctionalExpressionGrammar : DefaultSymbolicExpressionGrammar {
    32     [Storable]
    33     private HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable variableSymbol;
    34 
    3532    public FullFunctionalExpressionGrammar()
    3633      : base() {
     
    6057      constant.MinValue = -20;
    6158      constant.MaxValue = 20;
    62       variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable();
     59      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable();
     60      var laggedVariable = new LaggedVariable();
     61      laggedVariable.InitialFrequency = 0.0;
    6362
    64       var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, exp, @if, gt, lt, and, or, not, constant, variableSymbol };
     63      var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, exp, @if, gt, lt, and, or, not, constant, variableSymbol, laggedVariable };
    6564      var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, not };
    6665      var binaryFunctionSymbols = new List<Symbol>() { gt, lt };
    6766      var functionSymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or };
     67      var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable };
    6868
    6969      foreach (var symb in allSymbols)
     
    8383      }
    8484
     85      foreach (var terminalSymbol in terminalSymbols) {
     86        SetMinSubtreeCount(terminalSymbol, 0);
     87        SetMaxSubtreeCount(terminalSymbol, 0);
     88      }
     89
    8590      SetMinSubtreeCount(@if, 3);
    8691      SetMaxSubtreeCount(@if, 3);
    87       SetMinSubtreeCount(constant, 0);
    88       SetMaxSubtreeCount(constant, 0);
    89       SetMinSubtreeCount(variableSymbol, 0);
    90       SetMaxSubtreeCount(variableSymbol, 0);
     92
    9193
    9294      // allow each symbol as child of the start symbol
Note: See TracChangeset for help on using the changeset viewer.