Changeset 5080
- Timestamp:
- 12/10/10 17:38:49 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis/3.3/MultiAnalyzer.cs
r4722 r5080 35 35 [Item("MultiAnalyzer", "An analyzer which applies arbitrary many other analyzers.")] 36 36 [StorableClass] 37 public class MultiAnalyzer : CheckedMultiOperator<IAnalyzer>, I Analyzer {37 public class MultiAnalyzer : CheckedMultiOperator<IAnalyzer>, IMultiAnalyzer { 38 38 public override bool CanChangeName { 39 39 get { return false; } -
trunk/sources/HeuristicLab.Core/3.3/HeuristicLab.Core-3.3.csproj
r4477 r5080 143 143 <Compile Include="Constraints\IConstraint.cs" /> 144 144 <Compile Include="Constraints\TypeCompatibilityConstraint.cs" /> 145 <Compile Include="Interfaces\IMultiOperator.cs" /> 145 146 <Compile Include="OperatorExecutionException.cs" /> 146 147 <Compile Include="Interfaces\IScopeTreeLookupParameter.cs" /> -
trunk/sources/HeuristicLab.Operators/3.3/MultiOperator.cs
r4722 r5080 34 34 [Item("MultiOperator", "A base class for operators which apply arbitrary many other operators of a specific type.")] 35 35 [StorableClass] 36 public abstract class MultiOperator<T> : SingleSuccessorOperator where T : class, IOperator {36 public abstract class MultiOperator<T> : SingleSuccessorOperator, IMultiOperator<T> where T : class, IOperator { 37 37 private List<IValueParameter<T>> operatorParameters; 38 38 … … 68 68 Initialize(); 69 69 } 70 70 71 71 private void Initialize() { 72 72 if (operators != null) RegisterOperatorsEvents(); -
trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
r4564 r5080 112 112 <Compile Include="Algorithm.cs" /> 113 113 <Compile Include="BatchRun.cs" /> 114 <Compile Include="Interfaces\IMultiAnalyzer.cs" /> 114 115 <Compile Include="Interfaces\IIterationBasedOperator.cs" /> 115 116 <Compile Include="Interfaces\IRealVectorDecoder.cs" /> -
trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IMultiAnalyzer.cs
r5078 r5080 20 20 #endregion 21 21 22 22 23 using HeuristicLab.Core; 23 24 24 namespace HeuristicLab.Optimization { 25 25 /// <summary> 26 /// An interface which represents an analysis operator.26 /// An interface which represents an multi analysis operator. 27 27 /// </summary> 28 public interface I Analyzer : IOperator { }28 public interface IMultiAnalyzer : IMultiOperator<IAnalyzer>, IAnalyzer { } 29 29 } -
trunk/sources/HeuristicLab.Optimization/3.3/UserDefinedAlgorithm.cs
r4722 r5080 20 20 #endregion 21 21 22 using System.Linq; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 50 51 } 51 52 53 private IValueParameter AnalyzerParameter { 54 get { return (IValueParameter)Parameters["Analyzer"]; } 55 } 56 private IMultiAnalyzer Analyzer { 57 get { 58 if (AnalyzerParameter != null) 59 return AnalyzerParameter.Value as IMultiAnalyzer; 60 return null; 61 } 62 } 63 52 64 public UserDefinedAlgorithm() : base() { } 53 65 public UserDefinedAlgorithm(string name) : base(name) { } … … 64 76 return new UserDefinedAlgorithm(this, cloner); 65 77 } 78 79 #region update of problem specific analyzers 80 protected override void OnProblemChanged() { 81 AddProblemAnalyzer(); 82 base.OnProblemChanged(); 83 } 84 protected override void Problem_OperatorsChanged(object sender, System.EventArgs e) { 85 RemoveProblemAnalyzers(); 86 AddProblemAnalyzer(); 87 base.Problem_OperatorsChanged(sender, e); 88 } 89 90 protected override void DeregisterProblemEvents() { 91 RemoveProblemAnalyzers(); 92 base.DeregisterProblemEvents(); 93 } 94 95 private void RemoveProblemAnalyzers() { 96 if (Analyzer != null) { 97 foreach (var analyzer in Problem.Operators.OfType<IAnalyzer>()) 98 Analyzer.Operators.Remove(analyzer); 99 } 100 } 101 private void AddProblemAnalyzer() { 102 if (Analyzer != null && Problem != null) { 103 foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) { 104 Analyzer.Operators.Add(analyzer); 105 } 106 } 107 } 108 #endregion 66 109 } 67 110 }
Note: See TracChangeset
for help on using the changeset viewer.