1 / 13

Cilk Pousse

Cilk Pousse. James Process CS534. Overview. Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion. Introduction. 1998 ICFP Functional Programming Contest Write and AI system to play "Pousse"

zarola
Download Presentation

Cilk Pousse

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cilk Pousse James Process CS534

  2. Overview • Introduction to Pousse • Searching • Evaluation Function • Move Ordering • Conclusion

  3. Introduction 1998 ICFP Functional Programming Contest • Write and AI system to play "Pousse" • May be written in any language • Teams had 72 hours to complete the programming • Almost 50 programs were entered into the content • Cilk Pousse written by Supercomputing Technologies Research Group of the MIT LCS won first place

  4. Introduction - Pousse What is Pousse? • 2 player game • tic-tac-toe variant played on n-by-n board, typically 4-by-4 • players place either X or O, X places first • A marker is placed on the board by sliding it in from the side(left, right, top, or bottom) • Results in 4*n possible moves on a given turn • If a marker is inserted where a maker is already placed, all markers on that row/column are pushed down one space. If the row/column is full, the last marker is pushed off the game board and removed

  5. Introduction - Winning • Similar to tic-tac-toe you are trying to create "straights" to win • A "straight" is a full row or column of your marker • Making a move that causes the configuration to contain more straights of your type than your opponents results in a win • If you make a move that creates a configuration that is a repeat of a previous configuration you lose • No looping • There are no ties/draws

  6. Searching • Alpha-Beta minimax Searching • We can prune of parts of the tree and save search time if we know there is already a better move • Iterative deepening • For each iteration we start from the best possible move of the previous iteration. i.e. the depth-9 search places the best move into a hash table which provides a starting point for the depth-10 search

  7. Cilk and Parallel Searching • Cilk is a C-based language for multithreaded programming, did a lot of the work of multithreading/scheduling • Took the approach that either a single child would be searched or all children would be (optimal game tree) • Search first child • Either return, or spawn off all other children to be searched in parallel

  8. Evaluation Function • Piece count • Each piece is valued at 4 • Centrality • - Each piece gets a bonus equal to the Manhattan distance from the piece to the nearest corner • Frank-squared • Derived from file/rank • Valued at k^2 for each frank having k of your pieces • Connectivity • Originally was defined as 2 points per piece for adjacency and 1 point for each diagonal • Was not used in final version

  9. Evaluation Function Cont. Sum this for our pieces and subtract opponents sum at each state Optimized by incrementally updating score for each position rather than computing from scratch

  10. Move Ordering Two heuristics used to improve move ordering • First keep a hash table with the best move information from the previous search • Second keep a table of countermoves. • previously when the opponent made move x, we decided move y was a good choice • In the case of Cilk Pousse they saved the last 2 good countermoves for each move • If the best move hash table has a move start there, else go to the countermoves table

  11. Conclusion Even relatively simple problems require a large amount of thought and optimization to solve. All of the following were considered • Effective search algorithm • Good use of pruning • Iterative Depth • Keeping track of best states • Tweaking evaluation function • Parallelism • … • No single piece is the key to a perfect Agent

  12. References Definition of the game Pousse http://docs.racket-lang.org/games/pousse.html MIT CilkPousse http://people.csail.mit.edu/pousse/

More Related