claw::ai::game::game_state< Action, Numeric > Class Template Reference

Représentation de l'état du jeu. More...

#include <game_ai.hpp>

List of all members.

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_statedo_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.

Detailed Description

template<class Action, class Numeric = int>
class claw::ai::game::game_state< Action, Numeric >

Représentation de l'état du jeu.

Parameters:
Action Type des actions. Doit hériter de game_state.
Numeric Un type numérique pour l'évaluation des score.
Author:
Julien Jorge

Definition at line 49 of file game_ai.hpp.


Member Typedef Documentation

template<class Action, class Numeric = int>
typedef Action claw::ai::game::game_state< Action, Numeric >::action

Definition at line 54 of file game_ai.hpp.

template<class Action, class Numeric = int>
typedef Numeric claw::ai::game::game_state< Action, Numeric >::score

Le type de l'évaluation.

Definition at line 53 of file game_ai.hpp.


Constructor & Destructor Documentation

template<class Action , class Numeric >
claw::ai::game::game_state< Action, Numeric >::~game_state (  )  [inline, virtual]

Destructeur.

Definition at line 41 of file game_ai.tpp.

00042 {
00043 
00044 } // ~game_state() [destructeur]


Member Function Documentation

template<class Action, class Numeric = int>
virtual game_state* claw::ai::game::game_state< Action, Numeric >::do_action ( const action a  )  const [pure virtual]

Exécute une action.

Parameters:
a Action a effectuer.
Returns:
L'état résultant de cette action.
template<class Action, class Numeric = int>
virtual score claw::ai::game::game_state< Action, Numeric >::evaluate (  )  const [pure virtual]

Récupère l'évaluation de l'état.

template<class Action, class Numeric = int>
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.

template<class Action , class Numeric >
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.

Parameters:
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()

template<class Action , class Numeric >
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()

template<class Action , class Numeric >
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()

template<class Action, class Numeric = int>
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.

Parameters:
l (sortie) La liste des actions jouables.

Member Data Documentation

template<class Action, class Numeric = int>
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().

template<class Action, class Numeric = int>
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().


The documentation for this class was generated from the following files:

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1