ゲームに MinMax アルゴリズムを使用していますが、多くの可能性があるため、「アルファ ベータ プルーニング」を使用しても、MinMax 再帰に時間がかかりすぎます。
私のコードは次のようになります。
min(state,depth,alpha,beta):
if stopingCond:
return value
for moves in allmoves:
state.do(move)
beta = min(beta, max(state,depth,alpha,beta) )
if alpha >= beta: return beta
return beta
max(state,depth,alpha,beta):
if stopingCond:
return value
for moves in allmoves:
state.do(move)
alpha = max(beta, min(state,depth,alpha,beta) )
if alpha >= beta: return alpha
return beta
for
再帰の代わりにループを使用できる場合があることは知っていますが、それを変換する方法が見つかりませんでした。
誰かが良いアイデアを持っているなら、私はそれを聞いてうれしいです!
ありがとう、