Changeset 15108
- Timestamp:
- 07/03/17 09:35:48 (7 years ago)
- Location:
- stable
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 15084
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Core
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Core merged: 15084
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Core/3.3/Interfaces/IMultiOperator.cs
r14186 r15108 21 21 22 22 23 using System.Collections.Generic; 24 23 25 namespace HeuristicLab.Core { 24 public interface IMultiOperator<T> : IOperator where T : class,IOperator { 25 IItemList<T> Operators { get; } 26 public interface IMultiOperator : IOperator { 27 IEnumerable<IOperator> Operators { get; } 28 bool AddOperator(IOperator op); 29 bool RemoveOperator(IOperator op); 30 } 31 public interface IMultiOperator<T> : IMultiOperator where T : class,IOperator { 32 new IItemList<T> Operators { get; } 26 33 } 27 34 } -
stable/HeuristicLab.Operators/3.3/MultiOperator.cs
r14186 r15108 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using HeuristicLab.Collections; 25 26 using HeuristicLab.Common; … … 52 53 } 53 54 } 55 56 IEnumerable<IOperator> IMultiOperator.Operators { get { return operators.AsEnumerable(); } } 54 57 55 58 [StorableConstructor] … … 69 72 private void AfterDeserialization() { 70 73 Initialize(); 74 } 75 76 public virtual bool AddOperator(IOperator op) { 77 var tOp = op as T; 78 if (tOp == null) return false; 79 operators.Add(tOp); 80 return true; 81 } 82 83 public virtual bool RemoveOperator(IOperator op) { 84 var tOp = op as T; 85 if (tOp == null) return false; 86 return operators.Remove(tOp); 71 87 } 72 88 -
stable/HeuristicLab.Optimization
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Optimization merged: 15084
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization/3.3/BasicProblems/MultiObjectiveBasicProblem.cs
r14186 r15108 74 74 if (encoding != null && encoding.Operators.Any(x => x is ISingleObjectiveOperator && !(x is IMultiObjectiveOperator))) 75 75 encoding.Operators = encoding.Operators.Where(x => !(x is ISingleObjectiveOperator) || x is IMultiObjectiveOperator).ToList(); 76 77 foreach (var multiOp in Encoding.Operators.OfType<IMultiOperator>()) { 78 foreach (var soOp in multiOp.Operators.Where(x => x is ISingleObjectiveOperator).ToList()) { 79 multiOp.RemoveOperator(soOp); 80 } 81 } 76 82 } 77 83 -
stable/HeuristicLab.Optimization/3.3/BasicProblems/SingleObjectiveBasicProblem.cs
r14186 r15108 100 100 if (encoding.Operators.Any(x => x is IMultiObjectiveOperator && !(x is ISingleObjectiveOperator))) 101 101 encoding.Operators = encoding.Operators.Where(x => !(x is IMultiObjectiveOperator) || x is ISingleObjectiveOperator).ToList(); 102 103 foreach (var multiOp in Encoding.Operators.OfType<IMultiOperator>()) { 104 foreach (var moOp in multiOp.Operators.Where(x => x is IMultiObjectiveOperator).ToList()) { 105 multiOp.RemoveOperator(moOp); 106 } 107 } 102 108 } 103 109
Note: See TracChangeset
for help on using the changeset viewer.