Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/18/19 13:23:10 (6 years ago)
Author:
mkommend
Message:

#2521: Changed base ctor call in all GeneticProgrammingProblems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/ArtificialAnt/Problem.cs

    r16723 r16813  
    2323using System.Diagnostics.Contracts;
    2424using System.Linq;
     25using HEAL.Attic;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Core;
     
    2930using HeuristicLab.Optimization;
    3031using HeuristicLab.Parameters;
    31 using HEAL.Attic;
    3232
    3333
     
    116116    #endregion
    117117
    118     public Problem()
    119       : base() {
     118    public Problem() : base(new SymbolicExpressionTreeEncoding()) {
    120119      BoolMatrix world = new BoolMatrix(ToBoolMatrix(santaFeAntTrail));
    121120      Parameters.Add(new ValueParameter<BoolMatrix>("World", "The world for the artificial ant with scattered food items.", world));
    122121      Parameters.Add(new ValueParameter<IntValue>("MaximumTimeSteps", "The number of time steps the artificial ant has available to collect all food items.", new IntValue(600)));
    123122
    124       base.BestKnownQuality = 89;
    125123      var g = new SimpleSymbolicExpressionGrammar();
    126124      g.AddSymbols(new string[] { "IfFoodAhead", "Prog2" }, 2, 2);
    127125      g.AddSymbols(new string[] { "Prog3" }, 3, 3);
    128126      g.AddTerminalSymbols(new string[] { "Move", "Left", "Right" });
    129       base.Encoding = new SymbolicExpressionTreeEncoding(g, 20, 10);
     127
     128      Encoding.TreeLength = 20;
     129      Encoding.TreeDepth = 10;
     130      Encoding.Grammar = g;
     131      base.BestKnownQuality = 89;
    130132    }
    131133
Note: See TracChangeset for help on using the changeset viewer.