Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/04/15 00:03:14 (9 years ago)
Author:
abeham
Message:

#2174:

  • Added IImprovmentOperator interface to SingleObjectiveImprover
  • Added Random parameter to Analyze method and IStochasticOperator interface to the resp. analyzer
  • Updated code template text of the compiled single- and multi-objective problem definitions
  • Prevent ProblemDefinitionScript from silently ignoring exceptions
  • Added equality comparer in Encoding's cloning constructor
  • Small adaption of ProblemDefinitionScriptView to changes in new code editor
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/Scripts/Templates/CompiledMultiObjectiveProblemDefinition.cs

    r11786 r11880  
    1414
    1515    public override void Initialize() {
     16      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
    1617      // Define the solution encoding which can also consist of multiple vectors, examples below
    1718      //Encoding = new BinaryEncoding("b", length: 5);
     
    1920      //Encoding = new RealEncoding("r", length: 5, min: -1.0, max: 1.0);
    2021      //Encoding = new PermutationEncoding("p", length: 5, type: PermutationTypes.Absolute);
    21 
     22      // The encoding can also be a combination
    2223      //Encoding = new MultiEncoding()
    2324      //.Add(new BinaryEncoding("b", length: 5))
     
    2627      //.Add(new PermutationEncoding("p", length: 5, type: PermutationTypes.Absolute))
    2728      ;
     29      // Add additional initialization code e.g. private variables that you need for evaluating
    2830    }
    2931
    3032    public double[] Evaluate(Individual individual, IRandom random) {
     33      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
    3134      var qualities = new[] { 0.0, 0.0 };
    32       // use vars.yourVariable to access variables in the variable store i.e. yourVariable
    33       // qualities = new [] { individual.RealVector("r").Sum(x => x * x), individual.RealVector("r").Sum(x => x * x * x) };
     35      //qualities = new [] { individual.RealVector("r").Sum(x => x * x), individual.RealVector("r").Sum(x => x * x * x) };
    3436      return qualities;
    3537    }
    3638
    37     public void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results) {
    38       // write or update results given the range of vectors and resulting qualities
    39       // use e.g. vars.yourVariable to access variables in the variable store i.e. yourVariable
     39    public void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) {
     40      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
     41      // Write or update results given the range of vectors and resulting qualities
    4042    }
    41     // implement further classes and methods
     43    // Implement further classes and methods
    4244  }
    4345}
Note: See TracChangeset for help on using the changeset viewer.