Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/09/15 16:54:05 (9 years ago)
Author:
gkronber
Message:

#2283 worked on TD, and models for MCTS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GrammaticalOptimization/MctsSampler.cs

    r11742 r11744  
    4040    public int treeDepth;
    4141    public int treeSize;
     42    private double bestQuality;
    4243
    4344    // public MctsSampler(IProblem problem, int maxLen, Random random) :
     
    5556
    5657    public void Run(int maxIterations) {
    57       double bestQuality = double.MinValue;
     58      bestQuality = double.MinValue;
    5859      InitPolicies(problem.Grammar);
    5960      for (int i = 0; !rootNode.done && i < maxIterations; i++) {
     
    7778    public void PrintStats() {
    7879      var n = rootNode;
    79       Console.WriteLine("depth: {0,5} size: {1,10} root tries {2,10}", treeDepth, treeSize, n.actionInfo.Tries);
     80      Console.WriteLine("depth: {0,5} size: {1,10} root tries {2,10}, rootQ {3:F3}, bestQ {4:F3}", treeDepth, treeSize, n.actionInfo.Tries, n.actionInfo.Value, bestQuality);
    8081      while (n.children != null) {
    8182        Console.WriteLine();
     
    8687        n = n.children.Where(ch => !ch.done).OrderByDescending(c => c.actionInfo.Value).First();
    8788      }
    88       Console.ReadLine();
    8989    }
    9090
Note: See TracChangeset for help on using the changeset viewer.