Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/21/12 10:30:41 (12 years ago)
Author:
mkommend
Message:

#1837: Added view for sliding window GP and updated analyzer.

File:
1 edited

Legend:

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

    r7726 r7850  
    3232using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3333using HeuristicLab.PluginInfrastructure;
     34using HeuristicLab.Problems.Instances;
    3435
    3536namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3637  [StorableClass]
    37   public abstract class SymbolicDataAnalysisProblem<T, U, V> : HeuristicOptimizationProblem<U, V>, IDataAnalysisProblem<T>, ISymbolicDataAnalysisProblem, IStorableContent
     38  public abstract class SymbolicDataAnalysisProblem<T, U, V> : HeuristicOptimizationProblem<U, V>, IDataAnalysisProblem<T>, ISymbolicDataAnalysisProblem, IStorableContent,
     39    IProblemInstanceConsumer<T>, IProblemInstanceExporter<T>
    3840    where T : class, IDataAnalysisProblemData
    3941    where U : class, ISymbolicDataAnalysisEvaluator<T>
     
    204206      Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer());
    205207      Operators.Add(new SymbolicExpressionTreeLengthAnalyzer());
     208      Operators.Add(new GenerationalSlidingWindowAnalyzer<T>());
    206209      ParameterizeOperators();
    207210    }
     
    318321        op.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
    319322      }
    320     }
    321 
    322     public abstract void ImportProblemDataFromFile(string fileName);
     323
     324      foreach (var op in operators.OfType<SlidingWindowAnalyzer<T>>()) {
     325        op.FitnessCalculationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;
     326        op.ProblemDataParameter.ActualName = ProblemDataParameter.Name;
     327
     328        var start = ProblemData.TrainingPartition.Start;
     329        var end = ProblemData.TrainingPartition.End;
     330        var size = (end - start) / 5;
     331        op.SlidingWindowSize.Value = size;
     332        op.SlidingWindowStepWidth.Value = size / 2;
     333      }
     334    }
     335
     336    #region Import & Export
     337    public void Load(T data) {
     338      Name = data.Name;
     339      Description = data.Description;
     340      ProblemData = data;
     341      OnReset();
     342    }
     343
     344    public T Export() {
     345      return ProblemData;
     346    }
     347    #endregion
    323348  }
    324349}
Note: See TracChangeset for help on using the changeset viewer.