Exemple #1
0
 public static void ExpandNode(NodeTree current, int depth)
 {
     if (depth == 0)
     {
         current.Evaluation();
         SetProofAndDisproof(current);
         SetPNSbyScore(current);
         return;
     }
     if (!current.isExpanded)
     {
         current.initChildren();
     }
     foreach (NodeTree child in current.children)
     {
         searchCount++;
         child.nodeScore = child.Evaluation();
         SetProofAndDisproof(child);
         //SetPNSbyScore (child);
         if (child.isMaximizing)               //OR Node
         {
             if (child.proof == 0)
             {
                 break;
             }
         }
         else                 //AND Node
         {
             if (child.disproof == 0)
             {
                 break;
             }
         }
     }
     current.isExpanded = true;
 }