-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
I have a couple questions about the alphabeta_full_search_max_value function in games.jl.
- Suppose that the state is terminal, and the
utilityfunction returns a value that is< betabut> alpha. Shouldn't that still change the value ofalpha? - My understanding is that in Julia numeric arguments to a function are passed by value. Since this function doesn't return the new value of
alpha, I don't see how that value changes over the course of the search.
function alphabeta_full_search_max_value(game::T, player::String, state::String, alpha::Number, beta::Number) where {T <: AbstractGame}
if (terminal_test(game, state))
return utility(game, state, player)
end
local v::Float64 = -Inf64;
for action in actions(game, state)
v = max(v, alphabeta_full_search_min_value(game, player, result(game, state, action), alpha, beta));
if (v >= beta)
return v;
end
### ! changes external variable alpha ?
alpha = max(alpha, v);
end
return v;
end
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels