Changeset 6811


Ignore:
Timestamp:
09/20/11 18:32:08 (10 years ago)
Author:
gkronber
Message:

#1081 added configuration of default grammar for time-series prognosis and improved multiple update of variable impacts result

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveProblem.cs

    r6802 r6811  
    6262      MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength;
    6363
     64      SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
     65
     66      ConfigureGrammarSymbols();
     67
    6468      InitializeOperators();
    6569      UpdateEstimationLimits();
     70    }
     71   
     72    private void ConfigureGrammarSymbols() {
     73      var grammar = SymbolicExpressionTreeGrammar as TypeCoherentExpressionGrammar;
     74      if (grammar != null) grammar.ConfigureAsDefaultTimeSeriesPrognosisGrammar();
    6675    }
    6776
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisVariableFrequencyAnalyzer.cs

    r6728 r6811  
    8080      ItemArray<ISymbolicExpressionTree> expressions = SymbolicExpressionTreeParameter.ActualValue;
    8181      ResultCollection results = ResultCollection;
    82       DoubleMatrix impacts;
    8382      DataTable datatable;
    8483      if (VariableFrequenciesParameter.ActualValue == null) {
     
    8685        datatable.VisualProperties.XAxisTitle = "Generation";
    8786        datatable.VisualProperties.YAxisTitle = "Relative Variable Frequency";
    88         impacts = new DoubleMatrix();
    8987        VariableFrequenciesParameter.ActualValue = datatable;
    90         VariableImpactsParameter.ActualValue = impacts;
    9188        results.Add(new Result("Variable frequencies", "Relative frequency of variable references aggregated over the whole population.", datatable));
    92         results.Add(new Result("Variable impacts", "The relative variable relevance calculated as the average relative variable frequency over the whole run.", impacts));
    93       }
    94 
    95       impacts = VariableImpactsParameter.ActualValue;
     89        results.Add(new Result("Variable impacts", "The relative variable relevance calculated as the average relative variable frequency over the whole run.", new DoubleMatrix()));
     90      }
     91
    9692      datatable = VariableFrequenciesParameter.ActualValue;
    9793      // all rows must have the same number of values so we can just take the first
     
    117113                           .OrderByDescending(p => p.Impact)
    118114                           .ToList();
    119       var matrix = (IStringConvertibleMatrix)impacts;
     115      var impacts = new DoubleMatrix();
     116      var matrix = impacts as IStringConvertibleMatrix;
    120117      matrix.Rows = orderedImpacts.Count;
    121118      matrix.RowNames = orderedImpacts.Select(x => x.Name);
     
    127124      }
    128125
     126      VariableImpactsParameter.ActualValue = impacts;
     127      results["Variable impacts"].Value = impacts;
    129128      return base.Apply();
    130129    }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs

    r6803 r6811  
    192192      Symbols.Where(s => s.Name == TimeSeriesSymbolsName).First().Enabled = false;
    193193    }
     194
     195    public void ConfigureAsDefaultTimeSeriesPrognosisGrammar() {
     196      Symbols.Where(s => s is Variable).First().Enabled = false;
     197      Symbols.Where(s => s.Name == TrigonometricFunctionsName).First().Enabled = false;
     198      Symbols.Where(s => s.Name == PowerFunctionsName).First().Enabled = false;
     199      Symbols.Where(s => s.Name == ConditionalSymbolsName).First().Enabled = false;
     200    }
    194201  }
    195202}
Note: See TracChangeset for help on using the changeset viewer.