Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/03/19 15:37:38 (5 years ago)
Author:
mkommend
Message:

#2521: Renamed Solution to EncodedSolution.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/SingleObjectiveAnalyzer.cs

    r16723 r16751  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HEAL.Attic;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Core;
     
    2829using HeuristicLab.Operators;
    2930using HeuristicLab.Parameters;
    30 using HEAL.Attic;
    3131
    3232namespace HeuristicLab.Optimization {
    3333  [Item("Single-objective Analyzer", "Calls the script's Analyze method to be able to write into the results collection.")]
    3434  [StorableType("3D20F8E2-CE11-4021-A05B-CFCB02C0FD6F")]
    35   public sealed class SingleObjectiveAnalyzer<TSolution> : SingleSuccessorOperator, ISingleObjectiveAnalysisOperator<TSolution>, IAnalyzer, IStochasticOperator
    36   where TSolution : class, ISolution {
     35  public sealed class SingleObjectiveAnalyzer<TEncodedSolution> : SingleSuccessorOperator, ISingleObjectiveAnalysisOperator<TEncodedSolution>, IAnalyzer, IStochasticOperator
     36  where TEncodedSolution : class, IEncodedSolution {
    3737    public bool EnabledByDefault { get { return true; } }
    3838
    39     public ILookupParameter<IEncoding<TSolution>> EncodingParameter {
    40       get { return (ILookupParameter<IEncoding<TSolution>>)Parameters["Encoding"]; }
     39    public ILookupParameter<IEncoding<TEncodedSolution>> EncodingParameter {
     40      get { return (ILookupParameter<IEncoding<TEncodedSolution>>)Parameters["Encoding"]; }
    4141    }
    4242
     
    5353    }
    5454
    55     public Action<TSolution[], double[], ResultCollection, IRandom> AnalyzeAction { get; set; }
     55    public Action<TEncodedSolution[], double[], ResultCollection, IRandom> AnalyzeAction { get; set; }
    5656
    5757    [StorableConstructor]
    5858    private SingleObjectiveAnalyzer(StorableConstructorFlag _) : base(_) { }
    59     private SingleObjectiveAnalyzer(SingleObjectiveAnalyzer<TSolution> original, Cloner cloner) : base(original, cloner) { }
     59    private SingleObjectiveAnalyzer(SingleObjectiveAnalyzer<TEncodedSolution> original, Cloner cloner) : base(original, cloner) { }
    6060    public SingleObjectiveAnalyzer() {
    61       Parameters.Add(new LookupParameter<IEncoding<TSolution>>("Encoding", "An item that holds the problem's encoding."));
     61      Parameters.Add(new LookupParameter<IEncoding<TEncodedSolution>>("Encoding", "An item that holds the problem's encoding."));
    6262      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The quality of the parameter vector."));
    6363      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The results collection to write to."));
     
    6666
    6767    public override IDeepCloneable Clone(Cloner cloner) {
    68       return new SingleObjectiveAnalyzer<TSolution>(this, cloner);
     68      return new SingleObjectiveAnalyzer<TEncodedSolution>(this, cloner);
    6969    }
    7070
     
    7878        scopes = scopes.Select(x => (IEnumerable<IScope>)x.SubScopes).Aggregate((a, b) => a.Concat(b));
    7979
    80       var individuals = scopes.Select(s => ScopeUtil.GetSolution(s, encoding)).ToArray();
     80      var individuals = scopes.Select(s => ScopeUtil.GetEncodedSolution(s, encoding)).ToArray();
    8181      AnalyzeAction(individuals, QualityParameter.ActualValue.Select(x => x.Value).ToArray(), results, random);
    8282      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.