You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a couple questions about the alphabeta_full_search_max_value function in games.jl.
Suppose that the state is terminal, and the utility function returns a value that is < beta but > alpha. Shouldn't that still change the value of alpha?
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
The text was updated successfully, but these errors were encountered:
I have a couple questions about the
alphabeta_full_search_max_value
function ingames.jl
.utility
function returns a value that is< beta
but> alpha
. Shouldn't that still change the value ofalpha
?alpha
, I don't see how that value changes over the course of the search.The text was updated successfully, but these errors were encountered: