1. Trang chủ
  2. » Giáo án - Bài giảng

trí tuệ nhân tạo cao hoàng trứ chương ter8 game playing sinhvienzone com

28 38 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

om nh Vi en Zo ne C Game Playing Si Chapter SinhVienZone.com https://fb.com/sinhvienzonevn Zo Minimax search ne C Overview nh Vi en Adding alpha-beta cutoffs Additional refinements Iterative deepening Si • • • • • om Outline SinhVienZone.com https://fb.com/sinhvienzonevn om Overview C Old beliefs Zo ne Games provided a structured task in which it was very easy to measure success or failure Si nh Vi en Games did not obviously require large amounts of knowledge, thought to be solvable by straightforward search SinhVienZone.com https://fb.com/sinhvienzonevn om Overview C Chess Zo ne The average branching factor is around 35 nh Vi en In an average game, each player might make 50 moves Si One would have to examine 35100 positions SinhVienZone.com https://fb.com/sinhvienzonevn om Overview Si nh Vi en Zo ne C • Improve the generate procedure so that only good moves are generated SinhVienZone.com https://fb.com/sinhvienzonevn om Overview ne C • Improve the generate procedure so that only good moves are generated Si nh Vi en Zo plausible-moves vs legal-moves SinhVienZone.com https://fb.com/sinhvienzonevn om Overview Si nh Vi en Zo ne C • Improve the test procedure so that the best moves will be recognized and explored first SinhVienZone.com https://fb.com/sinhvienzonevn om Overview ne C • Improve the test procedure so that the best moves will be recognized and explored first Si nh Vi en Zo less moves to be evaluated SinhVienZone.com https://fb.com/sinhvienzonevn om Overview ne C • It is not usually possible to search until a goal state is found nh Vi en Zo • It has to evaluate individual board positions by estimating how likely they are to lead to a win Static evaluation function Si • Credit assignment problem (Minsky, 1963) SinhVienZone.com https://fb.com/sinhvienzonevn om Overview C • Good plausible-move generator Si nh Vi en Zo ne • Good static evaluation function 10 SinhVienZone.com https://fb.com/sinhvienzonevn .C Opponent(Position, Depth): om Minimax Search Zo ne for each S ∈ SUCCESSORS(Position) RESULT = Player(S, Depth + 1) nh Vi en NEW-VALUE = PLAYER-VALUE(RESULT) if NEW-VALUE < MIN-SCORE, then MIN-SCORE = NEW-VALUE Si return BEST-PATH = PATH(RESULT) + S VALUE = MIN-SCORE PATH = BEST-PATH 14 SinhVienZone.com https://fb.com/sinhvienzonevn .C Any-Player(Position, Depth): om Minimax Search Zo ne for each S ∈ SUCCESSORS(Position) RESULT = Any-Player(S, Depth + 1) nh Vi en NEW-VALUE = − VALUE(RESULT) if NEW-VALUE > BEST-SCORE, then BEST-SCORE = NEW-VALUE Si return BEST-PATH = PATH(RESULT) + S VALUE = BEST-SCORE PATH = BEST-PATH 15 SinhVienZone.com https://fb.com/sinhvienzonevn om Minimax Search ne C MINIMAX(Position, Depth, Player): Zo • MOVE-GEN(Position, Player) nh Vi en • STATIC(Position, Player) Si • DEEP-ENOUGH(Position, Depth) 16 SinhVienZone.com https://fb.com/sinhvienzonevn om Minimax Search C if DEEP-ENOUGH(Position, Depth), then return: Zo ne VALUE = STATIC(Position, Player) PATH = nil nh Vi en SUCCESSORS = MOVE-GEN(Position, Player) Si if SUCCESSORS is empty, then as in Step 17 SinhVienZone.com https://fb.com/sinhvienzonevn .C if SUCCESSORS is not empty: om Minimax Search ne RESULT-SUCC = MINIMAX(SUCC, Depth+1, Opp(Player)) Zo NEW-VALUE = - VALUE(RESULT-SUCC) nh Vi en if NEW-VALUE > BEST-SCORE, then: BEST-SCORE = NEW-VALUE Return: Si BEST-PATH = PATH(RESULT-SUCC) + SUCC VALUE = BEST-SCORE PATH = BEST-PATH 18 SinhVienZone.com https://fb.com/sinhvienzonevn om Adding Alpha-Beta Cutoffs Zo > α threshold ne C • At the player choice, maximize the static evaluation of the next position nh Vi en • At the opponent choice, minimize the static evaluation of the next position Si < β threshold 19 SinhVienZone.com https://fb.com/sinhvienzonevn om Adding Alpha-Beta Cutoffs C A I β cutoff Zo F nh Vi en E < 4? J Si D C > 3? ne B G α cutoff H Maximizing ply Player Minimizing ply Opponent Maximizing ply Player Minimizing ply Opponent 20 SinhVienZone.com https://fb.com/sinhvienzonevn om Adding Alpha-Beta Cutoffs C A C > α? I v≥β β cutoff Zo F G H v≤α nh Vi en E < β? J Si D β ne B α α cutoff Maximizing ply Player Minimizing ply Opponent Maximizing ply Player Minimizing ply Opponent 21 SinhVienZone.com https://fb.com/sinhvienzonevn Player(Position, Depth, α, β): om for each S ∈ SUCCESSORS(Position) C RESULT = Opponent(S, Depth + 1, α, β) nh Vi en α = NEW-VALUE Zo if NEW-VALUE > α, then ne NEW-VALUE = PLAYER-VALUE(RESULT) BEST-PATH = PATH(RESULT) + S if α ≥ β then return VALUE = α Si return PATH = BEST-PATH VALUE = α PATH = BEST-PATH 22 SinhVienZone.com https://fb.com/sinhvienzonevn Opponent(Position, Depth, α, β): om for each S ∈ SUCCESSORS(Position) C RESULT = Player(S, Depth + 1, α, β) nh Vi en β = NEW-VALUE Zo if NEW-VALUE < β, then ne NEW-VALUE = PLAYER-VALUE(RESULT) BEST-PATH = PATH(RESULT) + S if β ≤ α then return VALUE = β Si return PATH = BEST-PATH VALUE = β PATH = BEST-PATH 23 SinhVienZone.com https://fb.com/sinhvienzonevn Any-Player(Position, Depth, α, β): om for each S ∈ SUCCESSORS(Position) C RESULT = Any-Player(S, Depth + 1, −β, −α) nh Vi en α = NEW-VALUE Zo if NEW-VALUE > α, then ne NEW-VALUE = − VALUE(RESULT) BEST-PATH = PATH(RESULT) + S if α ≥ β then return VALUE = α Si return PATH = BEST-PATH VALUE = α PATH = BEST-PATH 24 SinhVienZone.com https://fb.com/sinhvienzonevn om Additional Refinements nh Vi en • Using book moves ne • Secondary search Zo • Waiting for quiescence C • Futility cutoffs Si • Not assuming opponent’s optimal move 25 SinhVienZone.com https://fb.com/sinhvienzonevn • Futility cutoffs Zo E < 4? I Si D nh Vi en B ne A J C om Additional Refinements F G 3.1 C > 3? H 26 SinhVienZone.com https://fb.com/sinhvienzonevn Zo Iteration Si nh Vi en Iteration ne C om Iterative Deepening Iteration 27 SinhVienZone.com https://fb.com/sinhvienzonevn om Homework 1-7, (Chapter 12 – AI Rich & Knight) Si nh Vi en Zo ne C Exercises 28 SinhVienZone.com https://fb.com/sinhvienzonevn ... https://fb.com/sinhvienzonevn om Overview C Old beliefs Zo ne Games provided a structured task in which it was very easy to measure success or failure Si nh Vi en Games did not obviously require large amounts... https://fb.com/sinhvienzonevn om Overview C Chess Zo ne The average branching factor is around 35 nh Vi en In an average game, each player might make 50 moves Si One would have to examine 35100 positions SinhVienZone.com

Ngày đăng: 30/01/2020, 23:10