using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace HeuristicLab.Problems.GrammaticalOptimization { public class RoyalRoadProblem : IProblem { // inspired by Mitchell, Forrest, Holland: "The Royal Road for Genetic Algorithms: Fitness Landscapes and GA Performance", 1992 private const string grammarString = @" G(S): S -> 1 | 0 | 1S | 0S "; private readonly IGrammar grammar; public RoyalRoadProblem() { this.grammar = new Grammar(grammarString); } public double GetBestKnownQuality(int maxLen) { // for now only an upper bound is returned, ideally all fitness cases are predicted correctly throw new NotImplementedException(); } public IGrammar Grammar { get { return grammar; } } public double Evaluate(string sentence) { throw new NotImplementedException(); } public string Hash(string terminalPhrase) { return terminalPhrase; } } }