- Timestamp:
- 05/05/10 02:02:51 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 added
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs
r3616 r3618 78 78 get { return (ValueParameter<IntValue>)Parameters["Elites"]; } 79 79 } 80 private ValueParameter<MultiAnalyzer > AnalyzerParameter {81 get { return (ValueParameter<MultiAnalyzer >)Parameters["Analyzer"]; }80 private ValueParameter<MultiAnalyzer<IPopulationAnalyzer>> AnalyzerParameter { 81 get { return (ValueParameter<MultiAnalyzer<IPopulationAnalyzer>>)Parameters["Analyzer"]; } 82 82 } 83 83 private ValueParameter<IntValue> MaximumGenerationsParameter { … … 119 119 set { ElitesParameter.Value = value; } 120 120 } 121 public MultiAnalyzer Analyzer {121 public MultiAnalyzer<IPopulationAnalyzer> Analyzer { 122 122 get { return AnalyzerParameter.Value; } 123 123 set { AnalyzerParameter.Value = value; } … … 140 140 get { return selectors; } 141 141 } 142 private BestAverageWorstQualityAnalyzer qualityAnalyzer;142 private PopulationBestAverageWorstQualityAnalyzer qualityAnalyzer; 143 143 #endregion 144 144 … … 153 153 Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 154 154 Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1))); 155 Parameters.Add(new ValueParameter<MultiAnalyzer >("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));155 Parameters.Add(new ValueParameter<MultiAnalyzer<IPopulationAnalyzer>>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer<IPopulationAnalyzer>())); 156 156 Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000))); 157 157 … … 291 291 } 292 292 private void InitializeAnalyzers() { 293 qualityAnalyzer = new BestAverageWorstQualityAnalyzer();293 qualityAnalyzer = new PopulationBestAverageWorstQualityAnalyzer(); 294 294 ParameterizeAnalyzers(); 295 295 } … … 353 353 Analyzer.Operators.Add(qualityAnalyzer); 354 354 if (Problem != null) { 355 foreach (I Analyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))355 foreach (IPopulationAnalyzer analyzer in Problem.Operators.OfType<IPopulationAnalyzer>().OrderBy(x => x.Name)) 356 356 Analyzer.Operators.Add(analyzer); 357 357 } -
trunk/sources/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj
r3616 r3618 85 85 <ItemGroup> 86 86 <None Include="HeuristicLabAnalysisPlugin.cs.frame" /> 87 <Compile Include="BestAverageWorstQualityAnalyzer.cs" />88 87 <Compile Include="BestAverageWorstQualityCalculator.cs" /> 89 88 <Compile Include="BestQualityMemorizer.cs" /> 90 89 <Compile Include="MultiAnalyzer.cs" /> 90 <Compile Include="PopulationBestAverageWorstQualityAnalyzer.cs" /> 91 91 <Compile Include="QualityDifferenceCalculator.cs" /> 92 92 <Compile Include="DataRow.cs" /> -
trunk/sources/HeuristicLab.Analysis/3.3/MultiAnalyzer.cs
r3616 r3618 32 32 /// An analyzer which applies arbitrary many other analyzers. 33 33 /// </summary> 34 [Item("MultiAnalyzer ", "An analyzer which applies arbitrary many other analyzers.")]34 [Item("MultiAnalyzer<T>", "An analyzer which applies arbitrary many other analyzers.")] 35 35 [StorableClass] 36 public class MultiAnalyzer : CheckedMultiOperator<IAnalyzer>, IAnalyzer {36 public class MultiAnalyzer<T> : CheckedMultiOperator<T>, IAnalyzer where T : class, IAnalyzer { 37 37 public override bool CanChangeName { 38 38 get { return false; } … … 69 69 counter.Value = 0; 70 70 OperationCollection next = new OperationCollection(); 71 foreach (IndexedItem< IAnalyzer> item in Operators.CheckedItems)71 foreach (IndexedItem<T> item in Operators.CheckedItems) 72 72 next.Add(ExecutionContext.CreateOperation(item.Value)); 73 73 next.Add(base.Apply()); -
trunk/sources/HeuristicLab.Analysis/3.3/PopulationBestAverageWorstQualityAnalyzer.cs
r3616 r3618 32 32 /// An operator which analyzes the best, average and worst solution quality in the current population. 33 33 /// </summary> 34 [Item(" BestAverageWorstQualityAnalyzer", "An operator which analyzes the best, average and worst solution quality in the current population.")]34 [Item("PopulationBestAverageWorstQualityAnalyzer", "An operator which analyzes the best, average and worst solution quality in the current population.")] 35 35 [StorableClass] 36 public sealed class BestAverageWorstQualityAnalyzer : AlgorithmOperator, IAnalyzer {36 public sealed class PopulationBestAverageWorstQualityAnalyzer : AlgorithmOperator, IPopulationAnalyzer { 37 37 #region Parameter properties 38 38 public ValueLookupParameter<BoolValue> MaximizationParameter { … … 69 69 70 70 [StorableConstructor] 71 private BestAverageWorstQualityAnalyzer(bool deserializing) : base() { }72 public BestAverageWorstQualityAnalyzer()71 private PopulationBestAverageWorstQualityAnalyzer(bool deserializing) : base() { } 72 public PopulationBestAverageWorstQualityAnalyzer() 73 73 : base() { 74 74 Initialize(); -
trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
r3617 r3618 87 87 <Compile Include="Algorithm.cs" /> 88 88 <Compile Include="BatchRun.cs" /> 89 <Compile Include="Interfaces\IMultiPopulationAnalyzer.cs" /> 90 <Compile Include="Interfaces\IPopulationAnalyzer.cs" /> 91 <Compile Include="Interfaces\ISolutionAnalyzer.cs" /> 89 92 <Compile Include="RunCollectionConstraints\RunCollectionComparisonConstraint.cs" /> 90 93 <Compile Include="RunCollectionConstraints\RunCollectionConstraintCollection.cs" /> -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/BestTSPSolutionAnalyzer.cs
r3616 r3618 36 36 [Item("BestTSPSolutionAnalyzer", "An operator for analyzing the best solution of Traveling Salesman Problems given in path representation using city coordinates.")] 37 37 [StorableClass] 38 public sealed class BestTSPSolutionAnalyzer : SingleSuccessorOperator, I Analyzer {38 public sealed class BestTSPSolutionAnalyzer : SingleSuccessorOperator, IPopulationAnalyzer { 39 39 public LookupParameter<DoubleMatrix> CoordinatesParameter { 40 40 get { return (LookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
Note: See TracChangeset
for help on using the changeset viewer.