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

#include <ntesukiSearcher.h>

Collaboration diagram for osl::ntesuki::NtesukiSearcher:
Collaboration graph
[legend]

List of all members.

Classes

class  AttackHelper
class  CallSimulationAttack
class  CallSimulationDefense
class  CallSimulationDefenseDisproof
class  DefenseHelper

Public Types

typedef NumEffectState State

Public Member Functions

 NtesukiSearcher (State &state, NtesukiMoveGenerator *mg, unsigned int table_limit, volatile int *stop_flag, bool verbose, int maxPass=NtesukiRecord::SIZE, NtesukiRecord::IWScheme iwscheme=NtesukiRecord::pn_iw, NtesukiRecord::PSScheme psscheme=NtesukiRecord::no_ps, NtesukiRecord::ISScheme isscheme=NtesukiRecord::no_is, int tsumero_cost=0, int tsumero_estimate=0, double gc_ratio=0.33)
 ~NtesukiSearcher ()
template<Player T>
int search ()
int searchSlow (Player attacker, int rnl=160000)
NtesukiTablegetTable ()
int getNodeCount () const
bool exceedReadNodeLimit () const

Static Public Attributes

static bool delay_non_pass = false
 探索のふるまいを制御する変数.
static bool ptt_invalid_defense = false
static bool delay_interpose = false
static bool delay_nopromote = false
static bool delay_non_attack = false
static bool read_attack_only = false
static bool ptt_non_attack = false
static bool ptt_siblings_fail = false
static bool ptt_siblings_success = false
static bool ptt_uncle = false
static bool ptt_aunt = false
static unsigned int dynamic_widening_width = 0
static const int NtesukiNotFound = -1
static const int ReadLimitReached = -2
static const int TableLimitReached = -3

Private Types

typedef std::vector< Movemoves_t
 ルートから現在探索中のノードまでの move.
typedef std::vector
< NtesukiRecord * > 
nodes_t
 ルートから現在探索中のノードまでの局面.

Private Member Functions

template<Player T>
NtesukiResult attack (NtesukiRecord *record, const NtesukiRecord *oracle_attack, const NtesukiRecord *oracle_defense, unsigned int proofLimit, unsigned int disproofLimit, int pass_left, const Move last_move)
 攻撃側の処理
template<Player T>
void attackWithOrder (NtesukiRecord *record, const NtesukiRecord *oracle_attack, const NtesukiRecord *oracle_defense, unsigned int proofLimit, unsigned int disproofLimit, int pass_left, const Move last_move)
template<Player T>
NtesukiMoveselectMoveAttack (NtesukiRecord *record, unsigned int &best_proof, unsigned int &sum_disproof, unsigned int &second_proof, unsigned int &best_disproof, unsigned int &step_cost, NtesukiMoveList &moves, const int pass_left)
template<Player T>
NtesukiResult defense (NtesukiRecord *record, const NtesukiRecord *oracle_attack, const NtesukiRecord *oracle_defense, unsigned int proofLimit, unsigned int disproofLimit, int pass_left, const Move last_move)
 防御に関する計算
template<Player T>
void defenseWithPlayer (NtesukiRecord *record, const NtesukiRecord *oracle_attack, const NtesukiRecord *oracle_defense, unsigned int proofLimit, unsigned int disproofLimit, int pass_left, const Move last_move)
template<Player T>
NtesukiMoveselectMoveDefense (NtesukiRecord *record, unsigned int &best_disproof, unsigned int &sum_proof, unsigned int &second_disproof, unsigned int &best_proof, unsigned int &step_cost, NtesukiMoveList &moves, const int pass_left, const Move last_move)
template<Player T>
void simulateSiblingsSuccess (NtesukiRecord *record, NtesukiRecord *record_best, int pass_left, unsigned int &success_count, unsigned int &total_count)
 受け手番で,ある手が Success だとわかった場合, 他の手も同様に Success にならないか Simulaition で調べる.
template<Player T>
void simulateSiblingsFail (NtesukiRecord *record, NtesukiRecord *record_best, int pass_left, unsigned int &success_count, unsigned int &total_count)
 攻め手番で,ある手が Fail だとわかった場合, 他の手も同様に Fail にならないか Simulaition で調べる.
template<Player T>
void handleNonAttack (NtesukiRecord *record, int pass_left)
 攻めになっていない手を除く.
template<Player T>
void handleTonshi (NtesukiRecord *record, int pass_left, const Move last_move)
 頓死がないか調べる.
template<Player T>
void handleInterpose (NtesukiRecord *record, int pass_left)
 無駄合候補が本当に無駄合が調べる.

Private Attributes

Statestate
NtesukiMoveGeneratormg
 手生成器.
NtesukiTable table
 トランスポジションテーブル.
NtesukiSimulationSearcher simulator
 シミュレーション探索器.
unsigned int node_count
 現在までに何ノード読んだか.
unsigned int read_node_limit
 最大何ノードまで読むか.
bool verbose
 経過をどこまで表示するか.
volatile int * stop_flag
 探索を途中で強制的に終了させるための flag.
PathEncoding path
 ルートから現在探索中のノードまでの path の hash値.
moves_t moves_played
nodes_t nodes_played
unsigned int max_pass
 λオーダ
NtesukiRecord::IWScheme iwscheme
 Iterative widening の scheme.
NtesukiRecord::PSScheme psscheme
 Player selection の scheme.
NtesukiRecord::ISScheme isscheme
 Inversion searching の scheme.
int tsumero_cost
 詰めろな手に関する cost
int tsumero_estimate
 詰めろな手に関する証明数の予測値
double gc_ratio
 GC の際にテーブル をどこまで小さくするか
unsigned int blockByAttackBack
unsigned int blockByPass
unsigned int attack_node_count
unsigned int attack_node_under_attack_count
unsigned int attack_node_moves_count
unsigned int defense_node_count
unsigned int defense_node_under_attack_count
unsigned int defense_node_moves_count
unsigned int pass_count
unsigned int pass_success_count
unsigned int pass_attack_count
unsigned int pass_attack_success_count
unsigned int sibling_defense_count
unsigned int sibling_defense_success_count
unsigned int sibling_attack_count
unsigned int sibling_attack_success_count
unsigned int isshogi_defense_count
unsigned int isshogi_defense_success_count
unsigned int isshogi_attack_count
unsigned int isshogi_attack_success_count
unsigned int immediate_win
unsigned int immediate_lose
unsigned int attack_back_count
unsigned int proof_without_inversion_count
unsigned int proof_AND_count
unsigned int disproof_by_inversion_count

Static Private Attributes

static const unsigned int INITIAL_PROOF_LIMIT
static const unsigned int INITIAL_DISPROOF_LIMIT

Detailed Description

Definition at line 20 of file ntesukiSearcher.h.


Member Typedef Documentation

typedef std::vector<Move> osl::ntesuki::NtesukiSearcher::moves_t [private]

ルートから現在探索中のノードまでの move.

Definition at line 54 of file ntesukiSearcher.h.

typedef std::vector<NtesukiRecord *> osl::ntesuki::NtesukiSearcher::nodes_t [private]

ルートから現在探索中のノードまでの局面.

Definition at line 58 of file ntesukiSearcher.h.

typedef NumEffectState osl::ntesuki::NtesukiSearcher::State

Definition at line 24 of file ntesukiSearcher.h.


Constructor & Destructor Documentation

osl::ntesuki::NtesukiSearcher::NtesukiSearcher ( State state,
NtesukiMoveGenerator mg,
unsigned int  table_limit,
volatile int *  stop_flag,
bool  verbose,
int  maxPass = NtesukiRecord::SIZE,
NtesukiRecord::IWScheme  iwscheme = NtesukiRecord::pn_iw,
NtesukiRecord::PSScheme  psscheme = NtesukiRecord::no_ps,
NtesukiRecord::ISScheme  isscheme = NtesukiRecord::no_is,
int  tsumero_cost = 0,
int  tsumero_estimate = 0,
double  gc_ratio = 0.33 
)

Member Function Documentation

template<Player T>
NtesukiResult osl::ntesuki::NtesukiSearcher::attack ( NtesukiRecord record,
const NtesukiRecord oracle_attack,
const NtesukiRecord oracle_defense,
unsigned int  proofLimit,
unsigned int  disproofLimit,
int  pass_left,
const Move  last_move 
) [private]
template<Player T>
void osl::ntesuki::NtesukiSearcher::attackWithOrder ( NtesukiRecord record,
const NtesukiRecord oracle_attack,
const NtesukiRecord oracle_defense,
unsigned int  proofLimit,
unsigned int  disproofLimit,
int  pass_left,
const Move  last_move 
) [private]
template<Player T>
NtesukiResult osl::ntesuki::NtesukiSearcher::defense ( NtesukiRecord record,
const NtesukiRecord oracle_attack,
const NtesukiRecord oracle_defense,
unsigned int  proofLimit,
unsigned int  disproofLimit,
int  pass_left,
const Move  last_move 
) [private]
template<Player T>
void osl::ntesuki::NtesukiSearcher::defenseWithPlayer ( NtesukiRecord record,
const NtesukiRecord oracle_attack,
const NtesukiRecord oracle_defense,
unsigned int  proofLimit,
unsigned int  disproofLimit,
int  pass_left,
const Move  last_move 
) [private]

Definition at line 272 of file ntesukiSearcher.h.

Definition at line 271 of file ntesukiSearcher.h.

Definition at line 188 of file ntesukiSearcher.cc.

template<Player T>
void osl::ntesuki::NtesukiSearcher::handleInterpose ( NtesukiRecord record,
int  pass_left 
) [private]
template<Player T>
void osl::ntesuki::NtesukiSearcher::handleNonAttack ( NtesukiRecord record,
int  pass_left 
) [private]
template<Player T>
void osl::ntesuki::NtesukiSearcher::handleTonshi ( NtesukiRecord record,
int  pass_left,
const Move  last_move 
) [private]
template<Player A>
template int osl::ntesuki::NtesukiSearcher::search< WHITE > ( )
int osl::ntesuki::NtesukiSearcher::searchSlow ( Player  attacker,
int  rnl = 160000 
) [inline]

Definition at line 261 of file ntesukiSearcher.h.

References osl::BLACK.

template<Player T>
osl::ntesuki::NtesukiMove * osl::ntesuki::NtesukiSearcher::selectMoveAttack ( NtesukiRecord record,
unsigned int &  best_proof,
unsigned int &  sum_disproof,
unsigned int &  second_proof,
unsigned int &  best_disproof,
unsigned int &  step_cost,
NtesukiMoveList moves,
const int  pass_left 
) [private]
template<Player T>
osl::ntesuki::NtesukiMove * osl::ntesuki::NtesukiSearcher::selectMoveDefense ( NtesukiRecord record,
unsigned int &  best_disproof,
unsigned int &  sum_proof,
unsigned int &  second_disproof,
unsigned int &  best_proof,
unsigned int &  step_cost,
NtesukiMoveList moves,
const int  pass_left,
const Move  last_move 
) [private]
template<Player T>
void osl::ntesuki::NtesukiSearcher::simulateSiblingsFail ( NtesukiRecord record,
NtesukiRecord record_best,
int  pass_left,
unsigned int &  success_count,
unsigned int &  total_count 
) [private]
template<Player T>
void osl::ntesuki::NtesukiSearcher::simulateSiblingsSuccess ( NtesukiRecord record,
NtesukiRecord record_best,
int  pass_left,
unsigned int &  success_count,
unsigned int &  total_count 
) [private]

受け手番で,ある手が Success だとわかった場合, 他の手も同様に Success にならないか Simulaition で調べる.

現在 $^n$ 探索中の場合には,原則 $^(n-1)$ move の場合には調べない.

e.g. 必至探索中には王手は調べない.

Definition at line 2090 of file ntesukiSearcher.tcc.

References CATCH_DFPN, osl::ntesuki::NtesukiMove::getMove(), osl::ntesuki::NtesukiRecord::getValue(), osl::ntesuki::NtesukiRecord::getValueWithPath(), osl::ntesuki::NtesukiRecord::isVisited(), moves, ntesuki_assert, RETURN_ON_STOP, osl::ntesuki::NtesukiMove::setBySimulation(), osl::ntesuki::NtesukiMove::setCheckmateSuccess(), and TRY_DFPN.


Member Data Documentation

Definition at line 125 of file ntesukiSearcher.h.

Definition at line 112 of file ntesukiSearcher.h.

Definition at line 114 of file ntesukiSearcher.h.

Definition at line 113 of file ntesukiSearcher.h.

Definition at line 107 of file ntesukiSearcher.h.

Definition at line 111 of file ntesukiSearcher.h.

Definition at line 115 of file ntesukiSearcher.h.

Definition at line 117 of file ntesukiSearcher.h.

Definition at line 116 of file ntesukiSearcher.h.

Definition at line 72 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

Definition at line 74 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

探索のふるまいを制御する変数.

Definition at line 69 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

Definition at line 73 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

Definition at line 126 of file ntesukiSearcher.h.

Definition at line 84 of file ntesukiSearcher.h.

GC の際にテーブル をどこまで小さくするか

Definition at line 101 of file ntesukiSearcher.h.

Definition at line 124 of file ntesukiSearcher.h.

Definition at line 124 of file ntesukiSearcher.h.

const unsigned int osl::ntesuki::NtesukiSearcher::INITIAL_DISPROOF_LIMIT [static, private]
Initial value:
      ProofDisproof::DISPROOF_LIMIT / 4

Definition at line 135 of file ntesukiSearcher.h.

const unsigned int osl::ntesuki::NtesukiSearcher::INITIAL_PROOF_LIMIT [static, private]
Initial value:
      ProofDisproof::PROOF_LIMIT / 4

Definition at line 133 of file ntesukiSearcher.h.

Inversion searching の scheme.

Definition at line 92 of file ntesukiSearcher.h.

Definition at line 123 of file ntesukiSearcher.h.

Definition at line 123 of file ntesukiSearcher.h.

Definition at line 122 of file ntesukiSearcher.h.

Definition at line 122 of file ntesukiSearcher.h.

Iterative widening の scheme.

Definition at line 88 of file ntesukiSearcher.h.

λオーダ

Definition at line 62 of file ntesukiSearcher.h.

手生成器.

Definition at line 30 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

Definition at line 55 of file ntesukiSearcher.h.

現在までに何ノード読んだか.

Definition at line 39 of file ntesukiSearcher.h.

Definition at line 59 of file ntesukiSearcher.h.

Definition at line 129 of file ntesukiSearcher.h.

Definition at line 119 of file ntesukiSearcher.h.

Definition at line 119 of file ntesukiSearcher.h.

Definition at line 118 of file ntesukiSearcher.h.

Definition at line 118 of file ntesukiSearcher.h.

ルートから現在探索中のノードまでの path の hash値.

Definition at line 51 of file ntesukiSearcher.h.

Definition at line 126 of file ntesukiSearcher.h.

Definition at line 126 of file ntesukiSearcher.h.

Player selection の scheme.

Definition at line 90 of file ntesukiSearcher.h.

Definition at line 82 of file ntesukiSearcher.h.

Definition at line 70 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

Definition at line 76 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

Definition at line 78 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

Definition at line 79 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

Definition at line 81 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

Definition at line 75 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

最大何ノードまで読むか.

Definition at line 42 of file ntesukiSearcher.h.

Definition at line 130 of file ntesukiSearcher.h.

Definition at line 121 of file ntesukiSearcher.h.

Definition at line 121 of file ntesukiSearcher.h.

Definition at line 120 of file ntesukiSearcher.h.

Definition at line 120 of file ntesukiSearcher.h.

シミュレーション探索器.

Definition at line 36 of file ntesukiSearcher.h.

Definition at line 27 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

探索を途中で強制的に終了させるための flag.

Definition at line 48 of file ntesukiSearcher.h.

トランスポジションテーブル.

Definition at line 33 of file ntesukiSearcher.h.

Referenced by NtesukiSearcher().

Definition at line 131 of file ntesukiSearcher.h.

詰めろな手に関する cost

Definition at line 95 of file ntesukiSearcher.h.

詰めろな手に関する証明数の予測値

Definition at line 98 of file ntesukiSearcher.h.

経過をどこまで表示するか.

Definition at line 45 of file ntesukiSearcher.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines