All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
osl::search::MoveGenerator Class Reference

#include <moveGenerator.h>

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

List of all members.

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 など
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)

Static Public Member Functions

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

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

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]

Definition at line 194 of file moveGenerator.cc.

References moves.

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 
)

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<osl::Player P>
template const MoveLogProb osl::search::MoveGenerator::nextMoveWithGeneration< WHITE > ( const SearchState2 ) [private]

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<osl::Player P>
template const MoveLogProb osl::search::MoveGenerator::nextTacticalMoveWithGeneration< WHITE > ( const SearchState2 ) [private]

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 
)

Definition at line 428 of file moveGenerator.cc.

References osl::move_generator::capture::generate(), max_see, and moves.

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.

Definition at line 114 of file moveGenerator.h.

References tried.


Member Data Documentation

Definition at line 64 of file moveGenerator.h.

Referenced by nextMove(), and nextTacticalMove().

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().

Definition at line 71 of file moveGenerator.h.

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

Definition at line 61 of file moveGenerator.h.

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.

Definition at line 75 of file moveGenerator.h.

Definition at line 73 of file moveGenerator.h.

Definition at line 66 of file moveGenerator.h.

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().

Definition at line 70 of file moveGenerator.h.

Definition at line 65 of file moveGenerator.h.

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines