Skip to content

Commit 1bc6a34

Browse files
corrects name error in minimax_tree_search function
1 parent a152100 commit 1bc6a34

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

axelrod/strategies/dbs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ def minimax_tree_search(begin_node, policy, max_depth):
346346
# depth is < max_depth
347347
siblings = begin_node.get_siblings()
348348
# The stochastic node value is the expected values of siblings
349-
node_value = (begin_node.pC * F(siblings[0], policy, max_depth)
350-
+ (1 - begin_node.pC) * F(siblings[1], policy, max_depth))
349+
node_value = (begin_node.pC * minimax_tree_search(siblings[0], policy, max_depth)
350+
+ (1 - begin_node.pC) * minimax_tree_search(siblings[1], policy, max_depth))
351351
return node_value
352352
else: # determinist node
353353
if begin_node.depth == max_depth:
@@ -358,15 +358,15 @@ def minimax_tree_search(begin_node, policy, max_depth):
358358
# this returns the two max expected values, for choice C or D,
359359
# as a tuple
360360
return (
361-
F(siblings[0], policy, max_depth) + begin_node.get_value(),
362-
F(siblings[1], policy, max_depth) + begin_node.get_value()
361+
minimax_tree_search(siblings[0], policy, max_depth) + begin_node.get_value(),
362+
minimax_tree_search(siblings[1], policy, max_depth) + begin_node.get_value()
363363
)
364364
elif begin_node.depth < max_depth:
365365
siblings = begin_node.get_siblings(policy)
366366
# the determinist node value is the max of both siblings values
367367
# + the score of the outcome of the node
368-
a = F(siblings[0], policy, max_depth)
369-
b = F(siblings[1], policy, max_depth)
368+
a = minimax_tree_search(siblings[0], policy, max_depth)
369+
b = minimax_tree_search(siblings[1], policy, max_depth)
370370
node_value = max(a, b) + begin_node.get_value()
371371
return node_value
372372

12 KB
Binary file not shown.

0 commit comments

Comments
 (0)