AIPlayer Class Reference

#include <ai_player.h>

Inheritance diagram for AIPlayer:

Player AIPercent

Detailed Description

This class is a pure interface, that must be implemented by all the AI (Artificial Intelligence) players.

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 RoundgetChosenRound () const =0
 Return the round played by the AI (if changesLetters() returns false).
virtual vector< TilegetChangedLetters () 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.


Constructor & Destructor Documentation

virtual AIPlayer::~AIPlayer  )  [inline, virtual]
 

Definition at line 63 of file ai_player.h.

AIPlayer::AIPlayer int  iId  )  [inline, protected]
 

This class is a pure interface, forbid any direct instanciation.

Definition at line 87 of file ai_player.h.


Member Function Documentation

virtual bool AIPlayer::changesLetters  )  const [pure virtual]
 

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.

virtual void AIPlayer::compute const Dictionary iDic,
Board iBoard,
int  turn
[pure virtual]
 

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.

virtual vector<Tile> AIPlayer::getChangedLetters  )  const [pure virtual]
 

Get the letters to change (if changesLetters() returns true).

Implemented in AIPercent.

virtual const Round& AIPlayer::getChosenRound  )  const [pure virtual]
 

Return the round played by the AI (if changesLetters() returns false).

Implemented in AIPercent.

virtual bool AIPlayer::isHuman  )  const [inline, virtual]
 

No human here. Trespassers will be shot!

Implements Player.

Definition at line 66 of file ai_player.h.


The documentation for this class was generated from the following file:
Generated on Thu Dec 29 02:01:15 2005 for Eliot by  doxygen 1.4.5