#include <ai_player.h>
Inheritance diagram for AIPlayer:
Note: we could implement various strategies (some of which are already implemented):
In fact, instead of working on the score of the words, these strategies could work on any other value. In particular, some heuristics could modulate the score with a value indicating the openings offered by the word (if a word makes accessible a "word counts triple" square, it is less interesting than another word with the same score or even with a slightly lower score, but which does not offer such a square).
More evolved heuristics could even take into account the remaining letters in the bag to guess the 'statistical rack' of the opponent, and play a word both maximizing the score and minimizing the opponent's score... Hmmm... i don't think this one will be implemented in a near future :)
Definition at line 60 of file ai_player.h.
Public Member Functions | |
virtual | ~AIPlayer () |
virtual bool | isHuman () const |
No human here. Trespassers will be shot! | |
virtual void | compute (const Dictionary &iDic, Board &iBoard, int turn)=0 |
This method does the actual computation. | |
virtual bool | changesLetters () const =0 |
Return true when the AI wants to change letters instead of playing a word. | |
virtual const Round & | getChosenRound () const =0 |
Return the round played by the AI (if changesLetters() returns false). | |
virtual vector< Tile > | getChangedLetters () const =0 |
Get the letters to change (if changesLetters() returns true). | |
Protected Member Functions | |
AIPlayer (int iId) | |
This class is a pure interface, forbid any direct instanciation. |
|
Definition at line 63 of file ai_player.h. |
|
This class is a pure interface, forbid any direct instanciation.
Definition at line 87 of file ai_player.h. |
|
Return true when the AI wants to change letters instead of playing a word. Should return false in duplicate mode, as it is not allowed to change letters. Implemented in AIPercent. |
|
This method does the actual computation. It will be called before any of the following methods, so it must prepare everything for them. Implemented in AIPercent. |
|
Get the letters to change (if changesLetters() returns true).
Implemented in AIPercent. |
|
Return the round played by the AI (if changesLetters() returns false).
Implemented in AIPercent. |
|
No human here. Trespassers will be shot!
Implements Player. Definition at line 66 of file ai_player.h. |