Changeset 3681 for trunk/sources/HeuristicLab.Problems.ArtificialAnt
- Timestamp:
- 05/06/10 19:02:45 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3
- Files:
-
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/Analyzers/BestAntTrailAnalyzer.cs
r3665 r3681 32 32 namespace HeuristicLab.Problems.ArtificialAnt.Analyzers { 33 33 /// <summary> 34 /// An operator for visualizing the best ant trail of an artificial ant problem.34 /// An operator for analyzing the best ant trail of an artificial ant problem. 35 35 /// </summary> 36 [Item(" PopulationBestAntTrailAnalyzer", "An operator for visualizing the best ant trail of an artificial ant problem.")]36 [Item("BestAntTrailAnalyzer", "An operator for analyzing the best ant trail of an artificial ant problem.")] 37 37 [StorableClass] 38 public sealed class PopulationBestAntTrailAnalyzer : SingleSuccessorOperator, IAntTrailPopulationAnalyzer {38 public sealed class BestAntTrailAnalyzer : SingleSuccessorOperator, IAntTrailAnalyzer { 39 39 public ILookupParameter<BoolMatrix> WorldParameter { 40 40 get { return (ILookupParameter<BoolMatrix>)Parameters["World"]; } 41 41 } 42 public ILookupParameter<ItemArray<SymbolicExpressionTree>> SymbolicExpressionTreeParameter {43 get { return ( ILookupParameter<ItemArray<SymbolicExpressionTree>>)Parameters["SymbolicExpressionTree"]; }42 public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { 43 get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters["SymbolicExpressionTree"]; } 44 44 } 45 public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {46 get { return ( ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }45 public ScopeTreeLookupParameter<DoubleValue> QualityParameter { 46 get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 47 47 } 48 48 public ILookupParameter<IntValue> MaxTimeStepsParameter { … … 56 56 } 57 57 58 public PopulationBestAntTrailAnalyzer()58 public BestAntTrailAnalyzer() 59 59 : base() { 60 60 Parameters.Add(new LookupParameter<BoolMatrix>("World", "The world with food items for the artificial ant.")); -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/Analyzers/IAntTrailAnalyzer.cs
r3665 r3681 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Parameters; 28 29 29 30 namespace HeuristicLab.Problems.ArtificialAnt.Analyzers { 30 public interface IAntTrail PopulationAnalyzer : IAnalyzer {31 ILookupParameter<ItemArray<DoubleValue>> QualityParameter { get; }32 ILookupParameter<ItemArray<SymbolicExpressionTree>> SymbolicExpressionTreeParameter { get; }31 public interface IAntTrailAnalyzer : IAnalyzer { 32 ScopeTreeLookupParameter<DoubleValue> QualityParameter { get; } 33 ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; } 33 34 ILookupParameter<BoolMatrix> WorldParameter { get; } 34 35 ILookupParameter<IntValue> MaxTimeStepsParameter { get; } -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntProblem.cs
r3651 r3681 188 188 } 189 189 190 public IEnumerable<IAntTrail PopulationAnalyzer> AntTrailAnalyzers {191 get { return operators.OfType<IAntTrail PopulationAnalyzer>(); }190 public IEnumerable<IAntTrailAnalyzer> AntTrailAnalyzers { 191 get { return operators.OfType<IAntTrailAnalyzer>(); } 192 192 } 193 193 #endregion … … 299 299 operators = new List<IOperator>(); 300 300 operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>().OfType<IOperator>()); 301 operators.Add(new PopulationBestAntTrailAnalyzer());302 operators.Add(new PopulationMinAvgMaxTreeSizeAnalyzer());301 operators.Add(new BestAntTrailAnalyzer()); 302 operators.Add(new MinAvgMaxSymbolicExpressionTreeSizeAnalyzer()); 303 303 ParameterizeAnalyzers(); 304 304 ParameterizeOperators(); … … 316 316 } 317 317 private void ParameterizeAnalyzers() { 318 foreach (IAntTrail PopulationAnalyzer analyzer in AntTrailAnalyzers) {318 foreach (IAntTrailAnalyzer analyzer in AntTrailAnalyzers) { 319 319 analyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName; 320 320 analyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; … … 322 322 analyzer.MaxTimeStepsParameter.ActualName = MaxTimeStepsParameter.Name; 323 323 } 324 foreach (ISymbolicExpressionTree PopulationAnalyzer analyzer in Operators.OfType<ISymbolicExpressionTreePopulationAnalyzer>()) {324 foreach (ISymbolicExpressionTreeAnalyzer analyzer in Operators.OfType<ISymbolicExpressionTreeAnalyzer>()) { 325 325 analyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 326 326 } -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/HeuristicLab.Problems.ArtificialAnt-3.3.csproj
r3631 r3681 81 81 </ItemGroup> 82 82 <ItemGroup> 83 <Compile Include="Analyzers\ IAntTrailPopulationAnalyzer.cs" />84 <Compile Include="Analyzers\ PopulationBestAntTrailAnalyzer.cs" />83 <Compile Include="Analyzers\BestAntTrailAnalyzer.cs" /> 84 <Compile Include="Analyzers\IAntTrailAnalyzer.cs" /> 85 85 <Compile Include="AntInterpreter.cs" /> 86 86 <Compile Include="HeuristicLabProblemsArtificialAntPlugin.cs" />
Note: See TracChangeset
for help on using the changeset viewer.