source: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/RoyalRoadProblem.cs @ 11727

Last change on this file since 11727 was 11727, checked in by gkronber, 5 years ago

#2283: worked on grammatical optimization problem solvers (simple MCTS done)

File size: 1017 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5
6namespace HeuristicLab.Problems.GrammaticalOptimization {
7  public class RoyalRoadProblem : IProblem {
8    // inspired by Mitchell, Forrest, Holland: "The Royal Road for Genetic Algorithms: Fitness Landscapes and GA Performance", 1992
9    private const string grammarString = @"
10G(S):
11S -> 1 | 0 | 1S | 0S
12";
13
14    private readonly IGrammar grammar;
15    public RoyalRoadProblem() {
16      this.grammar = new Grammar(grammarString);
17    }
18
19    public double GetBestKnownQuality(int maxLen) {
20      // for now only an upper bound is returned, ideally all fitness cases are predicted correctly
21      throw new NotImplementedException();
22    }
23
24    public IGrammar Grammar {
25      get { return grammar; }
26    }
27
28    public double Evaluate(string sentence) {
29      throw new NotImplementedException();
30    }
31    public string Hash(string terminalPhrase) {
32      return terminalPhrase;
33    }
34
35  }
36}
Note: See TracBrowser for help on using the repository browser.