Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/21/19 17:58:32 (5 years ago)
Author:
mkommend
Message:

#2521: First version of contexts in problem evaluation.

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

Legend:

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

    r17320 r17363  
    3939    double Evaluate(TEncodedSolution solution, IRandom random);
    4040    double Evaluate(TEncodedSolution solution, IRandom random, CancellationToken cancellationToken);
     41    void Evaluate(ISingleObjectiveSolutionContext<TEncodedSolution> solutionContext, IRandom random);
     42    void Evaluate(ISingleObjectiveSolutionContext<TEncodedSolution> solutionContext, IRandom random, CancellationToken cancellationToken);
    4143
    4244    void Analyze(TEncodedSolution[] solutions, double[] qualities, ResultCollection results, IRandom random);
     45    void Analyze(ISingleObjectiveSolutionContext<TEncodedSolution>[] solutionContexts, ResultCollection results, IRandom random);
     46
    4347    IEnumerable<TEncodedSolution> GetNeighbors(TEncodedSolution solution, IRandom random);
     48    IEnumerable<ISingleObjectiveSolutionContext<TEncodedSolution>> GetNeighbors(ISingleObjectiveSolutionContext<TEncodedSolution> solutionContext, IRandom random);
    4449  }
    4550}
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISolutionContext.cs

    r17357 r17363  
    2424
    2525namespace HeuristicLab.Optimization {
     26  //TODO discuss renaming to solution scope?
    2627  [StorableType("383A35EB-03C9-473D-A20B-EE34E00BC174")]
    2728  public interface ISolutionContext : IItem {
     
    3637  }
    3738
    38   public interface ISingleObjectiveSolutionContext : ISolutionContext {
    39     //TODO discuss with abeham hiding of base property
    40     new ISingleObjectiveEvaluationResult EvaluationResult { get; }
     39  public interface ISolutionContext<TEncodedSolution> : ISolutionContext
     40    where TEncodedSolution : class, IEncodedSolution {
     41    new TEncodedSolution EncodedSolution { get; }
    4142  }
    4243
    43   public interface IMultiObjectiveSolutionContext : ISolutionContext {
    44     new IMultiObjectiveEvaluationResult EvaluationResult { get; }
     44
     45  public interface ISingleObjectiveSolutionContext<TEncodedSolution> : ISolutionContext<TEncodedSolution>
     46    where TEncodedSolution : class, IEncodedSolution {
     47    //TODO discuss with abeham hiding of base property
     48    new ISingleObjectiveEvaluationResult EvaluationResult { get; set; }
     49  }
     50
     51  public interface IMultiObjectiveSolutionContext<TEncodedSolution> : ISolutionContext<TEncodedSolution>
     52    where TEncodedSolution : class, IEncodedSolution {
     53    new IMultiObjectiveEvaluationResult EvaluationResult { get; set; }
    4554  }
    4655
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/internal/INeighborBasedOperator.cs

    r17226 r17363  
    2929  internal interface INeighborBasedOperator<TEncodedSolution> : IEncodingOperator<TEncodedSolution>
    3030  where TEncodedSolution : class, IEncodedSolution {
    31     Func<TEncodedSolution, IRandom, IEnumerable<TEncodedSolution>> GetNeighborsFunc { get; set; }
     31    Func<ISingleObjectiveSolutionContext<TEncodedSolution>, IRandom, IEnumerable<ISingleObjectiveSolutionContext<TEncodedSolution>>> GetNeighbors { get; set; }
    3232  }
    3333}
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/internal/ISingleObjectiveAnalysisOperator.cs

    r17226 r17363  
    2121
    2222using System;
     23using HEAL.Attic;
    2324using HeuristicLab.Core;
    24 using HEAL.Attic;
    2525
    2626namespace HeuristicLab.Optimization {
     
    2828  internal interface ISingleObjectiveAnalysisOperator<TEncodedSolution> : IEncodingOperator<TEncodedSolution>, ISingleObjectiveOperator
    2929  where TEncodedSolution : class, IEncodedSolution {
    30     Action<TEncodedSolution[], double[], ResultCollection, IRandom> AnalyzeAction { get; set; }
     30    Action<ISingleObjectiveSolutionContext<TEncodedSolution>[], ResultCollection, IRandom> Analyze { get; set; }
    3131  }
    3232}
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/internal/ISingleObjectiveEvaluationOperator.cs

    r17226 r17363  
    2121
    2222using System;
     23using HEAL.Attic;
    2324using HeuristicLab.Core;
    24 using HEAL.Attic;
    2525
    2626namespace HeuristicLab.Optimization {
     
    2828  internal interface ISingleObjectiveEvaluationOperator<TEncodedSolution> : ISingleObjectiveEvaluator, IEncodingOperator<TEncodedSolution>
    2929  where TEncodedSolution : class, IEncodedSolution {
    30     Func<TEncodedSolution, IRandom, double> EvaluateFunc { get; set; }
     30    Action<ISingleObjectiveSolutionContext<TEncodedSolution>, IRandom> Evaluate { get; set; }
    3131  }
    3232}
Note: See TracChangeset for help on using the changeset viewer.