Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/12/15 20:40:11 (9 years ago)
Author:
gkronber
Message:

#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:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization-gkr/HeuristicLab.Problems.GrammaticalOptimization/Problems/FindPhrasesProblem.cs

    r12290 r12391  
    2929    private readonly double decoyReward;
    3030    private readonly bool phrasesAsSets;
     31    private readonly int alphabetSize;
     32    private readonly int numOptimalPhrases;
     33    private readonly int numDecoyPhrases;
    3134    private readonly SortedSet<string> optimalPhrases;
    3235    private readonly SortedSet<string> decoyPhrases;
    33     public string Name { get { return "FindPhrases"; } }
     36    public string Name { get { return string.Format("FindPhrases({0},{1},{2},{3},{4},{5},{6},{7})", alphabetSize, numPhrases, phraseLen, numOptimalPhrases, numDecoyPhrases, correctReward, decoyReward, phrasesAsSets); } }
    3437
    35     public FindPhrasesProblem(Random rand, int alphabetSize, int numPhrases, int phraseLen, int numOptimalPhrases, int numDecoyPhrases = 1,
     38    public FindPhrasesProblem(System.Random rand, int alphabetSize, int numPhrases, int phraseLen, int numOptimalPhrases, int numDecoyPhrases = 1,
    3639      double correctReward = 1.0, double decoyReward = 0.0, bool phrasesAsSets = false) {
    3740      if (alphabetSize <= 0 || alphabetSize > 26) throw new ArgumentException();
     
    4750      this.decoyReward = decoyReward;
    4851      this.phrasesAsSets = phrasesAsSets;
     52      this.alphabetSize = alphabetSize;
     53      this.numOptimalPhrases = numOptimalPhrases;
     54      this.numDecoyPhrases = numDecoyPhrases;
    4955
    5056      var sentenceSymbol = 'S';
Note: See TracChangeset for help on using the changeset viewer.