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

WM trí tuệ nhân tạo cao hoàng trứ lab4 game playing sinhvienzone com

2 46 0

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

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 2
Dung lượng 444,02 KB

Nội dung

TRƯỜNG ĐẠI HỌC BÁCH KHOA TP.HCM Khoa Khoa học & Kỹ thuật Máy tính LAB SESSION GAME PLAYING OBJECTIVE co m The objectives of Lab are to introduce (1) an implementation of the Minimax algorithm, (2) the usage of alpha-beta cut-off e EXPERIMENT Successfully solving the problem of space state search in Lab 2, now we advance the problem of on 2-ply game playing Similarly, first thing to is observing The whole algorithm had been nZ implemented in the file minimax.pl, which includes the following predicates: ie - The map of game states: For example, moves(a, [b c]) states that b and c are successors of a in the map nh V - Static function: For example, staticval(h, 1) states that static score of h is - max_to_move and min_to_move: define MAX’s nodes and MIN’s nodes Si - minimax and best: find the best moves, together with best score for the current player Note the notation of ‘;’ used in definition of minimax These two predicates call each other recursively Try to figure out their operational mechanisms - betterof: It compares the two values, depending on whether the current player is MAX or MIN Alpha-beta pruning is an extension of the Minimal implementation Therefore, students read the source file of alphabeta.pl themselves and should be prepared for the exercises SinhVienZone.com https://fb.com/sinhvienzonevn EXERCISE A Minimax algorithm 3.1 Try to run the minimax program successfully Change the map and the static scores to observe the different results 3.2 Enhance the minimax predicate as minimax(a, min, Next, Val) or minimax(a, max, Next, Val), i.e the role of the current player (MAX or MIN) is also defined when this predicate is invoked Remove all of the facts defined by max_to_move and min_to_move and try the enhanced minimax m 3.3 Use this enhanced minimax to play the game Tic-Tac-Toe automatically co B Alpha-beta pruning e 3.4 Try to run the alphabeta program successfully Change the map and the static scores to observe the different results nZ on 3.5 Enhance the alphabeta predicate as alphabeta(a, min, -infinity, +infinity, Next, Val) or alphabeta(a, max, -infinity, +infinity, Next, Val), i.e the role of the current player (MAX or MIN) is also defined when this predicate is invoked Remove all of the facts defined by max_to_move and min_to_move and try the enhanced alphabeta nh V ie 3.6 Enhance the alphabeta predicate to determine the number of look-ahead moves (the depth in search space), i.e alphabeta(Pos, Player, Alpha, Beta, Depth, Next, Val) Si 3.7 Use this enhanced alphabeta to play the game Tic-Tac-Toe automatically SinhVienZone.com https://fb.com/sinhvienzonevn ... max_to_move and min_to_move and try the enhanced minimax m 3.3 Use this enhanced minimax to play the game Tic-Tac-Toe automatically co B Alpha-beta pruning e 3.4 Try to run the alphabeta program successfully... alphabeta(Pos, Player, Alpha, Beta, Depth, Next, Val) Si 3.7 Use this enhanced alphabeta to play the game Tic-Tac-Toe automatically SinhVienZone.com https://fb.com/sinhvienzonevn

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