Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8203


Ignore:
Timestamp:
07/03/12 15:50:21 (12 years ago)
Author:
gkronber
Message:

#1682: minor improvements for semantic crossovers

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDepthConstrainedCrossover.cs

    r7521 r8203  
    4141
    4242    #region Parameter properties
    43     public ConstrainedValueParameter<StringValue> DepthRangeParameter {
    44       get { return (ConstrainedValueParameter<StringValue>)Parameters[DepthRangeParameterName]; }
     43    public IConstrainedValueParameter<StringValue> DepthRangeParameter {
     44      get { return (IConstrainedValueParameter<StringValue>)Parameters[DepthRangeParameterName]; }
    4545    }
    4646    #endregion
     
    8989      var depthRange = new IntRange();
    9090      const int depthOffset = 2; // skip the first 2 levels (root + startNode)
    91       switch ((int)Enum.Parse(typeof(Ranges), mode)) {
    92         case (int)Ranges.HighLevel:
     91      switch ((Ranges)Enum.Parse(typeof(Ranges), mode)) {
     92        case Ranges.HighLevel:
    9393          depthRange.Start = depthOffset; // skip the first 2 levels (root + startNode)
    9494          depthRange.End = depthRange.Start + (int)Math.Round(depth * 0.25);
    9595          break;
    96         case (int)Ranges.Standard:
     96        case Ranges.Standard:
    9797          depthRange.Start = depthOffset + (int)Math.Round(depth * 0.25);
    9898          depthRange.End = depthRange.Start + (int)Math.Round(depth * 0.5);
    9999          break;
    100         case (int)Ranges.LowLevel:
     100        case Ranges.LowLevel:
    101101          depthRange.Start = depthOffset + (int)Math.Round(depth * 0.75);
    102102          depthRange.End = Math.Max(depthRange.Start, depth);
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r8169 r8203  
    312312      foreach (var op in operators.OfType<ISymbolicDataAnalysisExpressionCrossover<T>>()) {
    313313        op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameterName;
    314       }
    315       foreach (var op in operators.OfType<ISymbolicDataAnalysisExpressionCrossover<T>>()) {
    316314        op.ProblemDataParameter.ActualName = ProblemDataParameter.Name;
    317315        op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;
Note: See TracChangeset for help on using the changeset viewer.