Claw  1.7.3
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
claw::ai::game::game_state< Action, Numeric > Class Template Referenceabstract

A state of a game. More...

#include <game_ai.hpp>

Public Types

typedef Numeric score
 The type used for evaluationg the players' scores.
 
typedef Action action
 A type representing an action of a player.
 

Public Member Functions

virtual score evaluate () const =0
 Evaluate this state of the game.
 
virtual void next_actions (std::list< action > &l) const =0
 Get all actions that can be done from this state. More...
 
virtual game_statedo_action (const action &a) const =0
 Get a new state obtained when applying an action. More...
 
virtual bool final () const =0
 Tell if the game is over.
 

Static Public Member Functions

static score min_score ()
 
static score max_score ()
 

Protected Member Functions

score fit (score score_val) const
 

Static Protected Attributes

static const score s_min_score
 Minimal score that can be given to a state.
 
static const score s_max_score
 Maximal score that can be given to a state.
 

Detailed Description

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

A state of a game.

Template parameters:

Definition at line 54 of file game_ai.hpp.

Member Function Documentation

§ do_action()

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

Get a new state obtained when applying an action.

Parameters
aThe action to apply.
Returns
The state resulting from this action.

§ next_actions()

template<typename Action , typename Numeric = int>
virtual void claw::ai::game::game_state< Action, Numeric >::next_actions ( std::list< action > &  l) const
pure virtual

Get all actions that can be done from this state.

Parameters
l(out) The actions.

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