예제 #1
0
 def testEvaluation(self):
     evaluator = Evaluator()
     self.assertEquals(0, EvaluateTree.createWith(Minus(Variable("A"), Variable("B")), [0]).alphaBeta(evaluator))
     self.assertEquals(0, EvaluateTree.createWith(Minus(Variable("A"), Variable("B")), [0, 1]).alphaBeta(evaluator))
     self.assertEquals(
         1, EvaluateTree.createWith(Minus(Variable("A"), Variable("B")), [0, 1, 2]).alphaBeta(evaluator)
     )
     self.assertEquals(
         1, EvaluateTree.createWith(Minus(Variable("A"), Variable("B")), [0, 1, 2, 3]).alphaBeta(evaluator)
     )
예제 #2
0
 def testEvaluateTreeIsAnAlphaBetaTree(self):
     self.assertTrue(isinstance(EvaluateTree.createWith(Minus(Variable("A"), Variable("B")), [0, 1]), AlphaBetaTree))