Changeset 17875
- Timestamp:
- 03/11/21 15:46:47 (4 years ago)
- 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
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 17832
- Property svn:mergeinfo changed
-
branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisMultiObjectiveProblem.cs
r17180 r17875 21 21 22 22 using System.Linq; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; 27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 28 using HeuristicLab.Optimization; 27 29 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 30 30 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 31 32 [StorableType("E9876DF8-ACFA-41C8-93B7-FA40C57CE459")] 32 33 public abstract class SymbolicDataAnalysisMultiObjectiveProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, ISymbolicDataAnalysisMultiObjectiveProblem 33 where T : class, IDataAnalysisProblemData34 where T : class, IDataAnalysisProblemData 34 35 where U : class, ISymbolicDataAnalysisMultiObjectiveEvaluator<T> 35 36 where V : class, ISymbolicDataAnalysisSolutionCreator { … … 97 98 op.MaximizationParameter.ActualName = MaximizationParameterName; 98 99 } 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 } 99 115 } 100 116 }
Note: See TracChangeset
for help on using the changeset viewer.