Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/02/15 14:44:48 (9 years ago)
Author:
aballeit
Message:

#2283 MCTS avoid stackoverflow..

File:
1 edited

Legend:

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

    r12827 r12829  
    2222            Reset();
    2323            int selections = 0;
     24            TreeNode currentNode;
     25            string phrase;
     26            string simulatedPhrase;
     27            double quality;
    2428            for (int i = 0; !StopRequested && i < maxIterations; i++)
    2529            {
    26                 lock (pauseLock)
    27                 {
    28                     if (isPaused)
    29                     {
    30                         Monitor.Wait(pauseLock);
    31                     }
    32                 }
    33                 TreeNode currentNode = rootNode;
     30                currentNode = rootNode;
    3431
    3532                while (!currentNode.IsLeaf())
     
    4239                }
    4340
    44                 string phrase = currentNode.phrase;
     41                phrase = currentNode.phrase;
    4542
    4643                if (phrase.Length <= maxLen)
     
    7168                if (currentNode.phrase.Length <= maxLen)
    7269                {
    73                     string simulatedPhrase;
    74                     double quality = simulation.Simulate(currentNode, out simulatedPhrase);
     70                    quality = simulation.Simulate(currentNode, out simulatedPhrase);
    7571                    OnSolutionEvaluated(simulatedPhrase, quality);
    7672
Note: See TracChangeset for help on using the changeset viewer.