Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization-gkr/HeuristicLab.Problems.GrammaticalOptimization/Interfaces/IGrammar.cs @ 13847

Last change on this file since 13847 was 12391, checked in by gkronber, 10 years ago

#2283: added shuffling of terminal symbols to the royal pair problem to make sure that there is no bias from order of terminal symbols.

File size: 964 bytes
Line 
1using System;
2using System.Collections.Generic;
3
4namespace HeuristicLab.Problems.GrammaticalOptimization {
5
6  // symbols are characters, possible nonterminal symbols are : 'A'..'Z'
7  // phrases and sentences are strings
8  // each symbol is only on element in a string
9
10  public interface IGrammar {
11    char SentenceSymbol { get; }
12    IEnumerable<char> NonTerminalSymbols { get; }
13    IEnumerable<char> TerminalSymbols { get; }
14    IEnumerable<char> Symbols { get; }
15
16    IEnumerable<Sequence> GetAlternatives(char nt);
17    IEnumerable<Sequence> GetTerminalAlternatives(char nt);
18    IEnumerable<Sequence> GetNonTerminalAlternatives(char nt);
19
20    int MinPhraseLength(Sequence phrase);
21    int MaxPhraseLength(Sequence phrase);
22    Sequence CompleteSentenceRandomly(System.Random random, Sequence phrase, int maxLen);
23
24    bool IsTerminal(char symbol);
25    bool IsTerminal(string phrase);
26    bool IsNonTerminal(char symbol);
27  }
28}
Note: See TracBrowser for help on using the repository browser.