Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/15 17:27:35 (8 years ago)
Author:
abeham
Message:

#2521: adapted templates, fixed missing reference in outdated plugin lawnmower

File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/Templates/SingleObjectiveProblem_Template.cs

    r13363 r13373  
    1616      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
    1717      // Define e.g. the length of the solution encoding or the solution creator by modifying the Encoding property
     18      // Encoding.Length = 100;
    1819      // Add additional initialization code e.g. private variables that you need for evaluating
    1920    }
     
    2526    }
    2627
    27     public override void Analyze(SOLUTION_CLASS[] solution, double[] qualities, ResultCollection results, IRandom random) {
     28    public override void Analyze(SOLUTION_CLASS[] solutions, double[] qualities, ResultCollection results, IRandom random) {
    2829      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
    2930      // Write or update results given the range of vectors and resulting qualities
    30       // Uncomment the following lines if you want to retrieve the best individual
     31      // Uncomment the following lines if you want to retrieve the best solution
    3132
    32       //var orderedIndividuals = individuals.Zip(qualities, (i, q) => new { Individual = i, Quality = q }).OrderBy(z => z.Quality);
    33       //var best = Maximization ? orderedIndividuals.Last().Individual : orderedIndividuals.First().Individual;
     33      //var orderedSolutions = solutions.Zip(qualities, (i, q) => new { Solution = i, Quality = q }).OrderBy(z => z.Quality);
     34      //var best = Maximization ? orderedSolutions.Last().Solution : orderedSolutions.First().Solution;
    3435
    3536      //if (!results.ContainsKey("Best Solution")) {
     
    3940    }
    4041
    41     public override IEnumerable<SOLUTION_CLASS> GetNeighbors(SOLUTION_CLASS individual, IRandom random) {
     42    public override IEnumerable<SOLUTION_CLASS> GetNeighbors(SOLUTION_CLASS solution, IRandom random) {
    4243      // Use vars.yourVariable to access variables in the variable store i.e. yourVariable
    4344      // Create new vectors, based on the given one that represent small changes
     
    4647        // Algorithm will draw only a finite amount of samples
    4748        // Change to a for-loop to return a concrete amount of neighbors
    48         var neighbor = (SOLUTION_CLASS)individual.Clone();
     49        var neighbor = (SOLUTION_CLASS)solution.Clone();
    4950        // modify the solution specified as neighbor
    5051        yield return neighbor;
Note: See TracChangeset for help on using the changeset viewer.