Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/15/20 13:53:11 (4 years ago)
Author:
mkommend
Message:

#2971: Added first draft of results implementation and problem adaptation.

Location:
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISingleObjectiveProblemDefinition.cs

    r17699 r17745  
    4343    void Evaluate(ISingleObjectiveSolutionContext<TEncodedSolution> solutionContext, IRandom random, CancellationToken cancellationToken);
    4444
    45     //TODO add cancellationtoken?
    46     void Analyze(ISingleObjectiveSolutionContext<TEncodedSolution>[] solutionContexts, ResultCollection results, IRandom random);
     45    //TODO add cancellation token?
     46    void Analyze(ISingleObjectiveSolutionContext<TEncodedSolution>[] solutionContexts, IRandom random);
    4747
    4848    //TODO remove neighbors from ProblemDefinition?
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/internal/ISingleObjectiveAnalysisOperator.cs

    r17699 r17745  
    2828  internal interface ISingleObjectiveAnalysisOperator<TEncodedSolution> : IEncodingOperator, ISingleObjectiveOperator
    2929  where TEncodedSolution : class, IEncodedSolution {
    30     Action<ISingleObjectiveSolutionContext<TEncodedSolution>[], ResultCollection, IRandom> Analyze { get; set; }
     30    Action<ISingleObjectiveSolutionContext<TEncodedSolution>[], IRandom> Analyze { get; set; }
    3131  }
    3232}
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/SingleObjectiveAnalyzer.cs

    r17699 r17745  
    5353    }
    5454
    55     public Action<ISingleObjectiveSolutionContext<TEncodedSolution>[], ResultCollection, IRandom> Analyze { get; set; }
     55    public Action<ISingleObjectiveSolutionContext<TEncodedSolution>[], IRandom> Analyze { get; set; }
    5656
    5757    [StorableConstructor]
     
    8282      }).ToArray();
    8383
    84       Analyze(solutionContexts, results, random);
     84      Analyze(solutionContexts, random);
    8585      foreach (var s in solutionContexts.Zip(scopes, Tuple.Create)) {
    8686        ScopeUtil.CopyToScope(s.Item2, s.Item1);
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/SingleObjectiveProblem.cs

    r17699 r17745  
    110110    }
    111111
    112     public virtual void Analyze(TEncodedSolution[] solutions, double[] qualities, ResultCollection results, IRandom random) { }
    113     public virtual void Analyze(ISingleObjectiveSolutionContext<TEncodedSolution>[] solutionContexts, ResultCollection results, IRandom random) {
    114       var solutions = solutionContexts.Select(c => c.EncodedSolution).ToArray();
    115       var qualities = solutionContexts.Select(c => c.EvaluationResult.Quality).ToArray();
    116       Analyze(solutions, qualities, results, random);
    117     }
     112    public virtual void Analyze(ISingleObjectiveSolutionContext<TEncodedSolution>[] solutionContexts, IRandom random) { }
    118113
    119114    public virtual IEnumerable<TEncodedSolution> GetNeighbors(TEncodedSolution solutions, IRandom random) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/SolutionContext.cs

    r17577 r17745  
    8585    public SingleObjectiveSolutionContext(TEncodedSolution encodedSolution) : base(encodedSolution) { }
    8686
    87 
    88     public SingleObjectiveSolutionContext(TEncodedSolution encodedSolution, IEvaluationResult evaluationResult) : base(encodedSolution, evaluationResult) { }
     87    public SingleObjectiveSolutionContext(TEncodedSolution encodedSolution, ISingleObjectiveEvaluationResult evaluationResult) : base(encodedSolution, evaluationResult) { }
    8988
    9089    [StorableConstructor]
     
    110109
    111110
    112     public MultiObjectiveSolutionContext(TEncodedSolution encodedSolution, IEvaluationResult evaluationResult) : base(encodedSolution, evaluationResult) { }
     111    public MultiObjectiveSolutionContext(TEncodedSolution encodedSolution, IMultiObjectiveEvaluationResult evaluationResult) : base(encodedSolution, evaluationResult) { }
    113112
    114113    [StorableConstructor]
Note: See TracChangeset for help on using the changeset viewer.