Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/11/15 20:11:35 (9 years ago)
Author:
gkronber
Message:

#2283: cleanup and included HeuristicLab.dlls to create a self-contained branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/Problems/SantaFeAntProblem.cs

    r11980 r11981  
    140140      var isTerminal = grammar.IsTerminal(phrase);
    141141
    142 
    143142      yield return new Feature(isTerminal + ToString(), 1.0);
    144       //if (phrase.Length > 0) {
    145       //  var ant = new Ant(recordTrail: true);
    146       //  int pos = 0;
    147       //  Run(ant, phrase, ref pos, true);
    148       //  //yield return new Feature("food", ant.FoodEaten);
    149       //  yield return new Feature(ant.Trail, 1.0);
    150       //}
    151       //yield return new Feature(isTerminal + "const", 0.0);
    152       //yield return new Feature(isTerminal.ToString() + phrase.Length, 1.0);
    153       //int ntIdx;
    154       //for (ntIdx = 0; ntIdx < phrase.Length; ntIdx++) if (grammar.IsNonTerminal(phrase[ntIdx])) break;
    155       //for (int l = ntIdx-2; l >= 0; l--) {
    156       //  yield return new Feature(phrase.Substring(l, ntIdx-l-1), 1.0);
    157       //}
    158       //
     143     
    159144      yield return new Feature("$" + (phrase.Length > 0 ? phrase[0] : ' '), 1.0);
    160145      if (!isTerminal) {
     
    166151        }
    167152      }
    168       // var d = 0;
    169       // var ls = 0;
    170       // var rs = 0;
    171       // var qs = 0;
    172       // foreach (var ch in phrase) if (ch == 'l') { d--; ls++; } else if (ch == 'r') { d++; rs++; } else if (ch == '?') qs++;
    173       // yield return new Feature(isTerminal + "D" + Math.Abs(d), 1.0);
    174       // yield return new Feature(isTerminal + "R" + rs, 1.0);
    175       // yield return new Feature(isTerminal + "L" + ls, 1.0);
    176       // yield return new Feature(isTerminal + "?" + qs, 1.0);
    177 
     153   
    178154      yield return new Feature(phrase, 1.0);
    179       //for (int i = 0; i < phrase.Length; i++)
    180       //  yield return new Feature(i.ToString() + phrase[i].ToString(), 1.0);
    181       // yield return new Feature("Length", phrase.Length); //
    182       // foreach (var pair in phrase.Zip(phrase.Skip(1), Tuple.Create)) {
    183       //   yield return new Feature(pair.Item1.ToString() + pair.Item2, 1.0);
    184       // }
    185       // number of occurances for each symbol
    186155    }
    187156
Note: See TracChangeset for help on using the changeset viewer.