Représentation de l'état du jeu. More...
#include <game_ai.hpp>
Public Types | |
typedef Numeric | score |
Le type de l'évaluation. | |
typedef Action | action |
Public Member Functions | |
virtual | ~game_state () |
Destructeur. | |
virtual score | evaluate () const =0 |
Récupère l'évaluation de l'état. | |
virtual void | nexts_actions (std::list< action > &l) const =0 |
Récupère la listes des actions possibles. | |
virtual game_state * | do_action (const action &a) const =0 |
Exécute une action. | |
virtual bool | final () const =0 |
Indique s'il s'agit de l'état d'une partie terminée. | |
Static Public Member Functions | |
static score | min_score () |
Indique le score minimal d'un état. | |
static score | max_score () |
Indique le score maximal d'un état. | |
Protected Member Functions | |
score | fit (score score_val) const |
Troncature de l'évaluation par les bornes min et max. | |
Static Protected Attributes | |
static const score | s_min_score |
Score minimal d'un état. | |
static const score | s_max_score |
Score maximal d'un état. |
Représentation de l'état du jeu.
Action | Type des actions. Doit hériter de game_state. | |
Numeric | Un type numérique pour l'évaluation des score. |
Definition at line 49 of file game_ai.hpp.
typedef Action claw::ai::game::game_state< Action, Numeric >::action |
Definition at line 54 of file game_ai.hpp.
typedef Numeric claw::ai::game::game_state< Action, Numeric >::score |
Le type de l'évaluation.
Definition at line 53 of file game_ai.hpp.
claw::ai::game::game_state< Action, Numeric >::~game_state | ( | ) | [inline, virtual] |
Destructeur.
Definition at line 41 of file game_ai.tpp.
virtual game_state* claw::ai::game::game_state< Action, Numeric >::do_action | ( | const action & | a | ) | const [pure virtual] |
Exécute une action.
a | Action a effectuer. |
virtual score claw::ai::game::game_state< Action, Numeric >::evaluate | ( | ) | const [pure virtual] |
Récupère l'évaluation de l'état.
virtual bool claw::ai::game::game_state< Action, Numeric >::final | ( | ) | const [pure virtual] |
Indique s'il s'agit de l'état d'une partie terminée.
claw::ai::game::game_state< Action, Numeric >::score claw::ai::game::game_state< Action, Numeric >::fit | ( | score | score_val | ) | const [inline, protected] |
Troncature de l'évaluation par les bornes min et max.
score_val | Score à tronquer |
Definition at line 74 of file game_ai.tpp.
00075 { 00076 if ( s_max_score < score_val ) 00077 return s_max_score; 00078 else if ( score_val < s_min_score ) 00079 return s_min_score; 00080 else 00081 return score_val; 00082 } // fit()
Numeric claw::ai::game::game_state< Action, Numeric >::max_score | ( | ) | [inline, static] |
Indique le score maximal d'un état.
Definition at line 61 of file game_ai.tpp.
References claw::ai::game::game_state< Action, Numeric >::s_max_score.
00062 { 00063 return s_max_score; 00064 } // max_score()
Numeric claw::ai::game::game_state< Action, Numeric >::min_score | ( | ) | [inline, static] |
Indique le score minimal d'un état.
Definition at line 51 of file game_ai.tpp.
References claw::ai::game::game_state< Action, Numeric >::s_min_score.
00052 { 00053 return s_min_score; 00054 } // min_score()
virtual void claw::ai::game::game_state< Action, Numeric >::nexts_actions | ( | std::list< action > & | l | ) | const [pure virtual] |
Récupère la listes des actions possibles.
l | (sortie) La liste des actions jouables. |
const score claw::ai::game::game_state< Action, Numeric >::s_max_score [static, protected] |
Score maximal d'un état.
Definition at line 88 of file game_ai.hpp.
Referenced by claw::ai::game::game_state< Action, Numeric >::max_score().
const score claw::ai::game::game_state< Action, Numeric >::s_min_score [static, protected] |
Score minimal d'un état.
Definition at line 86 of file game_ai.hpp.
Referenced by claw::ai::game::game_state< Action, Numeric >::min_score().