Changeset 7268 for branches/HeuristicLab.TimeSeries/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers
- Timestamp:
- 01/03/12 11:22:21 (13 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries
- Property svn:mergeinfo changed
/trunk/sources merged: 7214,7216-7230,7233-7239,7241,7243-7252,7254,7256-7261,7265-7266
- Property svn:mergeinfo changed
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/MinAverageMaxSymbolicExpressionTreeLengthAnalyzer.cs
r7213 r7268 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 1Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.TimeSeries/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionSymbolFrequencyAnalyzer.cs
r7213 r7268 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 1Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.TimeSeries/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthAnalyzer.cs
r7213 r7268 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 1Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 22 23 using System.Linq; 23 24 using HeuristicLab.Analysis; … … 90 91 private SymbolicExpressionTreeLengthAnalyzer(SymbolicExpressionTreeLengthAnalyzer original, Cloner cloner) 91 92 : base(original, cloner) { 92 AfterDeserialization();93 93 } 94 94 public override IDeepCloneable Clone(Cloner cloner) { … … 106 106 Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, "The value which counts how many times the operator was called since the last update", new IntValue(0))); 107 107 108 AfterDeserialization(); 108 SymbolicExpressionTreeLengthsParameter.Hidden = true; 109 SymbolicExpressionTreeLengthsHistoryParameter.Hidden = true; 110 ResultsParameter.Hidden = true; 111 UpdateCounterParameter.Hidden = true; 109 112 } 110 113 … … 118 121 Parameters.Add(new ValueParameter<IntValue>(UpdateIntervalParameterName, "The interval in which the tree length analysis should be applied.", new IntValue(1))); 119 122 } 120 if (Parameters.ContainsKey(UpdateCounterParameterName)) 121 Parameters.Remove(UpdateCounterParameterName); 122 Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, "The value which counts how many times the operator was called since the last update", new IntValue(0))); 123 124 SymbolicExpressionTreeLengthsParameter.Hidden = true; 125 SymbolicExpressionTreeLengthsHistoryParameter.Hidden = true; 126 ResultsParameter.Hidden = true; 127 UpdateCounterParameter.Hidden = true; 128 } 123 if (!Parameters.ContainsKey(UpdateCounterParameterName)) { 124 Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, "The value which counts how many times the operator was called since the last update", new IntValue(0))); 125 UpdateCounterParameter.Hidden = true; 126 } 127 } 128 129 #region IStatefulItem members 130 public override void InitializeState() { 131 base.InitializeState(); 132 UpdateCounter.Value = 0; 133 } 134 public override void ClearState() { 135 base.ClearState(); 136 UpdateCounter.Value = 0; 137 } 138 #endregion 129 139 130 140 public override IOperation Apply() { … … 201 211 treeLengthsTable.VisualProperties.YAxisMaximumAuto = false; 202 212 treeLengthsTable.VisualProperties.YAxisMinimumFixedValue = 0.0; 203 int maxFreq = solutions.GroupBy(s => s.Length).Max(g => g.Count());213 int maxFreq = (int)Math.Round(solutions.GroupBy(s => s.Length).Max(g => g.Count()) / treeLengthsTableRow.VisualProperties.ScaleFactor); 204 214 if (maxFreq % 5 != 0) 205 215 maxFreq += (5 - maxFreq % 5); … … 221 231 222 232 if (storeHistory) { 223 // store tree lengths for each generation224 var historyDataRow = new DataRow("Tree lengths", "", treeLengthsTableRow.Values);225 historyDataRow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram;226 historyDataRow.VisualProperties.ExactBins = false;227 historyDataRow.VisualProperties.Bins = range;228 historyDataRow.VisualProperties.ScaleFactor = treeLengthsTableRow.VisualProperties.ScaleFactor;229 historyDataRow.VisualProperties.IsVisibleInLegend = false;230 var historyTable = new DataTable("Tree lengths");231 historyTable.Rows.Add(historyDataRow);232 // visual properties for the X-axis233 historyTable.VisualProperties.XAxisMinimumAuto = false;234 historyTable.VisualProperties.XAxisMaximumAuto = false;235 historyTable.VisualProperties.XAxisMinimumFixedValue = 0.0;236 if (maxLength > maximumAllowedTreeLength + 1)237 historyTable.VisualProperties.XAxisMaximumFixedValue = maxLength + 1; // +1 so the histogram column for the maximum length won't get trimmed238 else239 historyTable.VisualProperties.XAxisMaximumFixedValue = maximumAllowedTreeLength + 1;240 historyTable.VisualProperties.XAxisTitle = xAxisTitle;241 // visual properties for the Y-axis242 historyTable.VisualProperties.YAxisMinimumAuto = false;243 historyTable.VisualProperties.YAxisMaximumAuto = false;244 historyTable.VisualProperties.YAxisMinimumFixedValue = 0.0;245 historyTable.VisualProperties.YAxisMaximumFixedValue = yAxisMaximumFixedValue;246 historyTable.VisualProperties.YAxisTitle = yAxisTitle;247 248 233 var treeLengthsHistory = SymbolicExpressionTreeLengthsHistoryParameter.ActualValue; 249 234 if (treeLengthsHistory == null) { … … 251 236 SymbolicExpressionTreeLengthsHistoryParameter.ActualValue = treeLengthsHistory; 252 237 } 253 254 treeLengthsHistory.Add(historyTable); 238 treeLengthsHistory.Add((DataTable)treeLengthsTable.Clone()); 255 239 256 240 if (!results.ContainsKey(treeLengthHistoryTableName)) { -
branches/HeuristicLab.TimeSeries/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthCalculator.cs
r5809 r7268 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 1Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.