zoukankan      html  css  js  c++  java
  • Artificial Intelligence Minimax and Alpha Beta Pruning code

    function alphabeta(node, depth, α, β, Player)        

        if depth = 0 or node is a terminal node

            return the heuristic value of node

        if Player = MaxPlayer

            for each child of node

                α := max(α, alphabeta(child, depth-1, α, β, not(Player) ))    

                if β ≤ α

                    break                             (* Beta cut-off *)

            return α

        else

            for each child of node

                β := min(β, alphabeta(child, depth-1, α, β, not(Player) ))    

                if β ≤ α

                    break                             (* Alpha cut-off *)

            return β

    (* Initial call *)

    alphabeta(origin, depth, -infinity, +infinity, MaxPlayer)

  • 相关阅读:
    c/c++ -->对象和类
    zynq基础-->LINUX 设备树
    zynq基础-->yocto
    python3-->基础操作
    构建之法-->概论
    zynq基础-->linux下软件应用
    zynq基础-->系统构架
    网络基础-->http协议
    (转)频谱仪测试pll锁定时间
    modelsim仿真
  • 原文地址:https://www.cnblogs.com/pugang/p/2508215.html
Copyright © 2011-2022 走看看