Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17875


Ignore:
Timestamp:
03/11/21 15:46:47 (4 years ago)
Author:
gkronber
Message:

#3073: merged r17832 from trunk to branch

Location:
branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic

  • branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisMultiObjectiveProblem.cs

    r17180 r17875  
    2121
    2222using System.Linq;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
     27using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2628using HeuristicLab.Optimization;
    2729using HeuristicLab.Parameters;
    28 using HEAL.Attic;
    2930
    3031namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3132  [StorableType("E9876DF8-ACFA-41C8-93B7-FA40C57CE459")]
    3233  public abstract class SymbolicDataAnalysisMultiObjectiveProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, ISymbolicDataAnalysisMultiObjectiveProblem
    33     where T : class,IDataAnalysisProblemData
     34    where T : class, IDataAnalysisProblemData
    3435    where U : class, ISymbolicDataAnalysisMultiObjectiveEvaluator<T>
    3536    where V : class, ISymbolicDataAnalysisSolutionCreator {
     
    9798        op.MaximizationParameter.ActualName = MaximizationParameterName;
    9899      }
     100
     101      // these two crossover operators are compatible with single-objective problems only so we remove them from the operators collection
     102      bool pred(IItem x) {
     103        return x is SymbolicDataAnalysisExpressionDeterministicBestCrossover<T> || x is SymbolicDataAnalysisExpressionContextAwareCrossover<T>;
     104      };
     105      Operators.RemoveAll(pred);
     106      // if a multi crossover is present, remove them from its operator collection
     107      var cx = Operators.FirstOrDefault(x => x is MultiSymbolicDataAnalysisExpressionCrossover<T>);
     108      if (cx != null) {
     109        var multiCrossover = (MultiSymbolicDataAnalysisExpressionCrossover<T>)cx;
     110        var items = multiCrossover.Operators.Where(pred).Cast<ISymbolicExpressionTreeCrossover>().ToList();
     111        foreach (var item in items) {
     112          multiCrossover.Operators.Remove(item);
     113        }
     114      }
    99115    }
    100116  }
Note: See TracChangeset for help on using the changeset viewer.