Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/11/13 13:03:54 (12 years ago)
Author:
mkommend
Message:

#1837: Improved Sliding Window Analyzers to work with user defined algorithms.

Location:
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/GenerationalSlidingWindowAnalyzer.cs

    r7850 r9145  
    7474      Parameters.Add(new FixedValueParameter<IntValue>(GenerationsIntervalParameterName, "", new IntValue(5)));
    7575      Parameters.Add(new FixedValueParameter<IntValue>(GenerationsIntervalStartParameterName, "", new IntValue(0)));
    76 
    77       GenerationsIntervalStartParameter.Hidden = true;
    7876    }
    7977
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowAnalyzer.cs

    r7850 r9145  
    3838    private const string SlidingWindowSizeParameterName = "Sliding Window Size";
    3939    private const string SlidingWindowStepWidthParameterName = "Sliding Window Step Width";
     40    private const string InitialSlidingWindowParameterName = "Initial Sliding Window";
    4041
    4142    private const string SlidingWindowDataResultName = "Sliding Window";
     
    5859      get { return (IFixedValueParameter<IntValue>)Parameters[SlidingWindowStepWidthParameterName]; }
    5960    }
     61    public IFixedValueParameter<IntRange> InitialSlidingWindowParameter {
     62      get {
     63        return (IFixedValueParameter<IntRange>)Parameters[InitialSlidingWindowParameterName];
     64      }
     65    }
    6066    #endregion
    6167
     
    6470    public IntValue SlidingWindowSize { get { return SlidingWindowSizeParameter.Value; } }
    6571    public IntValue SlidingWindowStepWidth { get { return SlidingWindowStepWidthParameter.Value; } }
     72    public IntRange InitialSlidingWindow { get { return InitialSlidingWindowParameter.Value; } }
    6673    #endregion
    6774
     
    7885      Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowSizeParameterName, "", new IntValue(1)));
    7986      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";
    8090    }
    8191
    8292    public override IOperation Apply() {
    83       if (CheckForUpdate()) {
     93      if (FitnessCalculationPartitionParameter.ActualValue == null) {
     94        FitnessCalculationPartitionParameter.ActualValue = (IntRange)InitialSlidingWindow.Clone();
     95      } else if (CheckForUpdate()) {
    8496        var fitnessPartition = FitnessCalculationPartitionParameter.ActualValue;
    8597        if (fitnessPartition.End - fitnessPartition.Start == SlidingWindowSize.Value)
     
    89101        if (fitnessPartition.End - fitnessPartition.Start > SlidingWindowSize.Value)
    90102          fitnessPartition.End = fitnessPartition.Start + SlidingWindowSize.Value;
     103
     104        //TODO check if fitnesspartition exceeds training partition
    91105      }
    92106
     
    109123      slidingWindowData.SlidingWindowPosition.Start = FitnessCalculationPartitionParameter.ActualValue.Start;
    110124      slidingWindowData.SlidingWindowPosition.End = FitnessCalculationPartitionParameter.ActualValue.End;
     125
    111126      return base.Apply();
    112127    }
Note: See TracChangeset for help on using the changeset viewer.