Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization-gkr/HeuristicLab.Problems.GrammaticalOptimization/Problems/RoyalRoadProblem.cs @ 12893

Last change on this file since 12893 was 12893, checked in by gkronber, 9 years ago

#2283: experiments on grammatical optimization algorithms (maxreward instead of avg reward, ...)

File size: 1.3 KB
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 string Name { get { return "RoyalRoad"; } }
16    public RoyalRoadProblem() {
17      this.grammar = new Grammar(grammarString);
18    }
19
20    public double BestKnownQuality(int maxLen) {
21      // for now only an upper bound is returned, ideally all fitness cases are predicted correctly
22      throw new NotImplementedException();
23    }
24
25    public IGrammar Grammar {
26      get { return grammar; }
27    }
28
29    public double Evaluate(string sentence) {
30      throw new NotImplementedException();
31    }
32    public string CanonicalRepresentation(string phrase) {
33      return phrase;
34    }
35    public bool IsOptimalPhrase(string phrase) {
36      throw new NotImplementedException();
37    }
38
39    public IEnumerable<Feature> GetFeatures(string phrase)
40    {
41      throw new NotImplementedException();
42    }
43  }
44}
Note: See TracBrowser for help on using the repository browser.