Changeset 9145 for branches/Sliding Window GP
- Timestamp:
- 01/11/13 13:03:54 (12 years ago)
- Location:
- branches/Sliding Window GP
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/GenerationalSlidingWindowAnalyzer.cs
r7850 r9145 74 74 Parameters.Add(new FixedValueParameter<IntValue>(GenerationsIntervalParameterName, "", new IntValue(5))); 75 75 Parameters.Add(new FixedValueParameter<IntValue>(GenerationsIntervalStartParameterName, "", new IntValue(0))); 76 77 GenerationsIntervalStartParameter.Hidden = true;78 76 } 79 77 -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowAnalyzer.cs
r7850 r9145 38 38 private const string SlidingWindowSizeParameterName = "Sliding Window Size"; 39 39 private const string SlidingWindowStepWidthParameterName = "Sliding Window Step Width"; 40 private const string InitialSlidingWindowParameterName = "Initial Sliding Window"; 40 41 41 42 private const string SlidingWindowDataResultName = "Sliding Window"; … … 58 59 get { return (IFixedValueParameter<IntValue>)Parameters[SlidingWindowStepWidthParameterName]; } 59 60 } 61 public IFixedValueParameter<IntRange> InitialSlidingWindowParameter { 62 get { 63 return (IFixedValueParameter<IntRange>)Parameters[InitialSlidingWindowParameterName]; 64 } 65 } 60 66 #endregion 61 67 … … 64 70 public IntValue SlidingWindowSize { get { return SlidingWindowSizeParameter.Value; } } 65 71 public IntValue SlidingWindowStepWidth { get { return SlidingWindowStepWidthParameter.Value; } } 72 public IntRange InitialSlidingWindow { get { return InitialSlidingWindowParameter.Value; } } 66 73 #endregion 67 74 … … 78 85 Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowSizeParameterName, "", new IntValue(1))); 79 86 Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowStepWidthParameterName, "", new IntValue(1))); 87 Parameters.Add(new FixedValueParameter<IntRange>(InitialSlidingWindowParameterName, "", new IntRange(0, 1))); 88 89 FitnessCalculationPartitionParameter.ActualName = "Sliding Window"; 80 90 } 81 91 82 92 public override IOperation Apply() { 83 if (CheckForUpdate()) { 93 if (FitnessCalculationPartitionParameter.ActualValue == null) { 94 FitnessCalculationPartitionParameter.ActualValue = (IntRange)InitialSlidingWindow.Clone(); 95 } else if (CheckForUpdate()) { 84 96 var fitnessPartition = FitnessCalculationPartitionParameter.ActualValue; 85 97 if (fitnessPartition.End - fitnessPartition.Start == SlidingWindowSize.Value) … … 89 101 if (fitnessPartition.End - fitnessPartition.Start > SlidingWindowSize.Value) 90 102 fitnessPartition.End = fitnessPartition.Start + SlidingWindowSize.Value; 103 104 //TODO check if fitnesspartition exceeds training partition 91 105 } 92 106 … … 109 123 slidingWindowData.SlidingWindowPosition.Start = FitnessCalculationPartitionParameter.ActualValue.Start; 110 124 slidingWindowData.SlidingWindowPosition.End = FitnessCalculationPartitionParameter.ActualValue.End; 125 111 126 return base.Apply(); 112 127 } -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
r9126 r9145 231 231 Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer()); 232 232 Operators.Add(new SymbolicExpressionTreeLengthAnalyzer()); 233 Operators.Add(new GenerationalSlidingWindowAnalyzer<T>());234 233 ParameterizeOperators(); 235 234 } … … 351 350 op.EvaluatorParameter.ActualName = EvaluatorParameter.Name; 352 351 } 353 354 foreach (var op in operators.OfType<SlidingWindowAnalyzer<T>>()) {355 op.FitnessCalculationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;356 op.ProblemDataParameter.ActualName = ProblemDataParameter.Name;357 358 var start = ProblemData.TrainingPartition.Start;359 var end = ProblemData.TrainingPartition.End;360 var size = (end - start) / 5;361 op.SlidingWindowSize.Value = size;362 op.SlidingWindowStepWidth.Value = size / 2;363 }364 352 } 365 353
Note: See TracChangeset
for help on using the changeset viewer.