All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
osl::search::MoveGenerator Class Reference

#include <moveGenerator.h>

Collaboration diagram for osl::search::MoveGenerator:
Collaboration graph
[legend]

Public Member Functions

 MoveGenerator ()
 
template<class EvalT >
void init (int limit, const SimpleHashRecord *record, const EvalT &, const NumEffectState &, bool in_pv, Move hash_move, bool quiesce=false)
 
template<Player P>
const MoveLogProb nextTacticalMove (const SearchState2 &state)
 
template<Player P>
const MoveLogProb nextMove (const SearchState2 &state)
 
void registerMove (const NumEffectState &state, Move m)
 killer move など More...
 
int triedMoves () const
 
const PieceMask & myPins () const
 
void dump () const
 
void generateAll (Player P, const SearchState2 &state, analyzer::CategoryMoveVector &)
 
template<Player P>
void generateAll (const SearchState2 &, MoveLogProbVector &)
 
void generateAll (Player P, const SearchState2 &state, MoveLogProbVector &out)
 
const MoveLogProbVector & generated () const
 
template<Player P>
void quiesceCapture (const NumEffectState &, Square)
 
template<osl::Player P>
const osl::MoveLogProb nextTacticalMoveWithGeneration (const SearchState2 &state)
 
template<osl::Player P>
const osl::MoveLogProb nextMoveWithGeneration (const SearchState2 &state)
 

Static Public Member Functions

static int captureValue (Ptype)
 
static void initOnce ()
 call this before any use of instance of MoveGenerator More...
 

Private Types

enum  State {
  INITIAL, KING_ESCAPE, TAKE_BACK, BREAK_THREATMATE,
  CAPTURE, TACTICAL_FINISH, TESUJI, ALL,
  FINISH
}
 
typedef void(MoveGenerator::* generator_t )(const SearchState2 &)
 

Private Member Functions

template<Player P>
const MoveLogProb nextMoveWithGeneration (const SearchState2 &)
 
template<Player P>
const MoveLogProb nextTacticalMoveWithGeneration (const SearchState2 &)
 
template<Player P>
void generateKingEscape (const SearchState2 &state)
 
template<Player P>
void generateTakeBack (const SearchState2 &state)
 
template<Player P>
void generateBreakThreatmate (const SearchState2 &state)
 
template<Player P>
void generateCapture (const SearchState2 &state)
 
template<Player P>
void generateTesuji (const SearchState2 &state)
 
template<Player P>
void generateAllExp (const SearchState2 &state)
 
template<Player P>
void generateAll (const SearchState2 &state)
 
template<Player P>
void addCapture (const NumEffectState &, const RatingEnv &, const MoveVector &)
 

Private Attributes

MoveLogProbVector moves
 
int cur_state
 
size_t cur_index
 
const SimpleHashRecordrecord
 
int limit
 
int tried
 
MoveMarker marker
 
RatingEnv env
 
Progress32 progress
 
Move eval_suggestion
 
bool in_quiesce
 
bool in_pv
 

Static Private Attributes

static const CArray2d
< generator_t, 2, FINISH
Generators
 
static const CArray< const
char *, FINISH
GeneratorNames
 

Detailed Description

Definition at line 53 of file moveGenerator.h.

Member Typedef Documentation

typedef void(MoveGenerator::* osl::search::MoveGenerator::generator_t)(const SearchState2 &)
private

Definition at line 59 of file moveGenerator.h.

Member Enumeration Documentation

Enumerator
INITIAL 
KING_ESCAPE 
TAKE_BACK 
BREAK_THREATMATE 
CAPTURE 
TACTICAL_FINISH 
TESUJI 
ALL 
FINISH 

Definition at line 55 of file moveGenerator.h.

Constructor & Destructor Documentation

osl::search::MoveGenerator::MoveGenerator ( )

Definition at line 150 of file moveGenerator.cc.

Member Function Documentation

template<osl::Player P>
void osl::search::MoveGenerator::addCapture ( const NumEffectState &  state,
const RatingEnv &  env,
const MoveVector &  src 
)
private
int osl::search::MoveGenerator::captureValue ( Ptype  ptype)
static
void osl::search::MoveGenerator::dump ( ) const

Definition at line 194 of file moveGenerator.cc.

References moves.

void osl::search::MoveGenerator::generateAll ( Player  P,
const SearchState2 state,
analyzer::CategoryMoveVector out 
)

Definition at line 487 of file moveGenerator.cc.

References moves, and osl::playerToIndex().

Referenced by osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot().

template<osl::Player P>
void osl::search::MoveGenerator::generateAll ( const SearchState2 state,
MoveLogProbVector &  out 
)
void osl::search::MoveGenerator::generateAll ( Player  P,
const SearchState2 state,
MoveLogProbVector &  out 
)

Definition at line 530 of file moveGenerator.cc.

References osl::BLACK, and out.

template<osl::Player P>
void osl::search::MoveGenerator::generateAll ( const SearchState2 state)
private
template<Player P>
void osl::search::MoveGenerator::generateAllExp ( const SearchState2 state)
private
template<osl::Player P>
void osl::search::MoveGenerator::generateBreakThreatmate ( const SearchState2 state)
private
template<osl::Player P>
void osl::search::MoveGenerator::generateCapture ( const SearchState2 state)
private

Definition at line 384 of file moveGenerator.cc.

References osl::search::SearchState2Core::state().

const MoveLogProbVector& osl::search::MoveGenerator::generated ( ) const
inline

Definition at line 125 of file moveGenerator.h.

References moves.

template<osl::Player P>
void osl::search::MoveGenerator::generateKingEscape ( const SearchState2 state)
private
template<osl::Player P>
void osl::search::MoveGenerator::generateTakeBack ( const SearchState2 state)
private
template<osl::Player P>
void osl::search::MoveGenerator::generateTesuji ( const SearchState2 state)
private
template<class EvalT >
void osl::search::MoveGenerator::init ( int  limit,
const SimpleHashRecord record,
const EvalT &  eval,
const NumEffectState &  state,
bool  in_pv,
Move  hash_move,
bool  quiesce = false 
)
void osl::search::MoveGenerator::initOnce ( )
static

call this before any use of instance of MoveGenerator

Definition at line 43 of file moveGenerator.cc.

References osl::rating::StandardFeatureSet::instance().

Referenced by osl::search::AlphaBeta2< EvalT >::AlphaBeta2().

const PieceMask& osl::search::MoveGenerator::myPins ( ) const
inline

Definition at line 115 of file moveGenerator.h.

References env.

template<Player P>
const MoveLogProb osl::search::MoveGenerator::nextMove ( const SearchState2 state)
inline
template<Player P>
template const MoveLogProb osl::search::MoveGenerator::nextMoveWithGeneration< WHITE > ( const SearchState2 )
private
template<osl::Player P>
const osl::MoveLogProb osl::search::MoveGenerator::nextMoveWithGeneration ( const SearchState2 state)

Definition at line 231 of file moveGenerator.cc.

References moves, and osl::playerToIndex().

template<Player P>
const MoveLogProb osl::search::MoveGenerator::nextTacticalMove ( const SearchState2 state)
inline
template<Player P>
template const MoveLogProb osl::search::MoveGenerator::nextTacticalMoveWithGeneration< WHITE > ( const SearchState2 )
private
template<osl::Player P>
const osl::MoveLogProb osl::search::MoveGenerator::nextTacticalMoveWithGeneration ( const SearchState2 state)

Definition at line 207 of file moveGenerator.cc.

References moves, and osl::playerToIndex().

template<osl::Player P>
void osl::search::MoveGenerator::quiesceCapture ( const NumEffectState &  state,
Square  to 
)
void osl::search::MoveGenerator::registerMove ( const NumEffectState &  state,
Move  m 
)
inline

killer move など

Definition at line 106 of file moveGenerator.h.

References osl::Move::isNormal(), marker, osl::search::MoveMarker::registerMove(), and tried.

int osl::search::MoveGenerator::triedMoves ( ) const
inline

Definition at line 114 of file moveGenerator.h.

References tried.

Member Data Documentation

size_t osl::search::MoveGenerator::cur_index
private

Definition at line 64 of file moveGenerator.h.

Referenced by nextMove(), and nextTacticalMove().

int osl::search::MoveGenerator::cur_state
private

Definition at line 63 of file moveGenerator.h.

Referenced by nextMove(), and nextTacticalMove().

RatingEnv osl::search::MoveGenerator::env
private

Definition at line 69 of file moveGenerator.h.

Referenced by myPins().

Move osl::search::MoveGenerator::eval_suggestion
private

Definition at line 71 of file moveGenerator.h.

const CArray< const char *, MoveGenerator::FINISH > osl::search::MoveGenerator::GeneratorNames
staticprivate
Initial value:
= {{
"INITIAL", "KING_ESCAPE", "TAKEBACK", "BREAK_THREATMATE", "TACTICAL", "SENTINEL", "TESUJI", "ALL",
}}

Definition at line 61 of file moveGenerator.h.

const CArray2d< MoveGenerator::generator_t, 2, MoveGenerator::FINISH > osl::search::MoveGenerator::Generators
staticprivate
Initial value:
= {{
{
0,
&MoveGenerator::generateKingEscape<BLACK>,
&MoveGenerator::generateTakeBack<BLACK>,
&MoveGenerator::generateBreakThreatmate<BLACK>,
&MoveGenerator::generateCapture<BLACK>,
0,
&MoveGenerator::generateTesuji<BLACK>,
&MoveGenerator::generateAll<BLACK>,
},
{
0,
&MoveGenerator::generateKingEscape<WHITE>,
&MoveGenerator::generateTakeBack<WHITE>,
&MoveGenerator::generateBreakThreatmate<WHITE>,
&MoveGenerator::generateCapture<WHITE>,
0,
&MoveGenerator::generateTesuji<WHITE>,
&MoveGenerator::generateAll<WHITE>,
}
}}

Definition at line 60 of file moveGenerator.h.

bool osl::search::MoveGenerator::in_pv
private

Definition at line 75 of file moveGenerator.h.

bool osl::search::MoveGenerator::in_quiesce
private

Definition at line 73 of file moveGenerator.h.

int osl::search::MoveGenerator::limit
private

Definition at line 66 of file moveGenerator.h.

MoveMarker osl::search::MoveGenerator::marker
private

Definition at line 68 of file moveGenerator.h.

Referenced by registerMove().

MoveLogProbVector osl::search::MoveGenerator::moves
private

Definition at line 62 of file moveGenerator.h.

Referenced by generated(), nextMove(), and nextTacticalMove().

Progress32 osl::search::MoveGenerator::progress
private

Definition at line 70 of file moveGenerator.h.

const SimpleHashRecord* osl::search::MoveGenerator::record
private

Definition at line 65 of file moveGenerator.h.

int osl::search::MoveGenerator::tried
private

Definition at line 67 of file moveGenerator.h.

Referenced by nextMove(), nextTacticalMove(), registerMove(), and triedMoves().


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