Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/16/15 18:55:07 (8 years ago)
Author:
pfleck
Message:

#1674

  • Added a SupportScript for the MultiObjectiveExternalEvaluationProblem.
  • Extracted code from the SingleObjectiveOptimizationSupportScript into the OptimizationSupportScript to reuse code for the MultiObjectiveOptimizationSupportScript.
File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/CompiledMultiObjectiveOptimizationSupport.cs

    r13166 r13183  
    88
    99namespace HeuristicLab.Problems.ExternalEvaluation {
    10   public class CompiledSingleObjectiveOptimizationSupport : CompiledOptimizationSupport, ISingleObjectiveOptimizationSupport {
     10  public class CompiledMultiObjectiveOptimizationSupport : CompiledOptimizationSupport, IMultiObjectiveOptimizationSupport {
    1111
    12     public void Analyze(Individual[] individuals, double[] qualities, ResultCollection results, IRandom random) {
     12    public void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
    1313      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
    1414      // Write or update results given the range of vectors and resulting qualities
     
    2020    }
    2121
    22     public IEnumerable<Individual> GetNeighbors(Individual individual, IRandom random) {
    23       // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
    24       // Create new vectors, based on the given one that represent small changes
    25       // This method is only called from move-based algorithms (Local Search, Simulated Annealing, etc.)
    26       while (true) {
    27         // Algorithm will draw only a finite amount of samples
    28         // Change to a for-loop to return a concrete amount of neighbors
    29         var neighbor = individual.Copy();
    30         // For instance, perform a single bit-flip in a binary parameter
    31         //var bIndex = random.Next(neighbor.BinaryVector("b").Length);
    32         //neighbor.BinaryVector("b")[bIndex] = !neighbor.BinaryVector("b")[bIndex];
    33         yield return neighbor;
    34       }
    35     }
    36 
    3722    // Implement further classes and methods
    3823  }
    3924}
    40 
Note: See TracChangeset for help on using the changeset viewer.