osl::checkmate::DualDfpn Class Reference

一般用詰み探索: 先手後手の詰みを別々に管理 More...

`#include <dualDfpn.h>`

## Public Member Functions

| DualDfpn (uint64_t ignored=std::numeric_limits< uint64_t >::max())
| DualDfpn (const DualDfpn &src)
| ~DualDfpn ()
void | setRootPlayer (Player)
template<Player P>
ProofDisproof | findProof (int node_limit, const NumEffectState &state, const HashKey &key, const PathEncoding &path, Move &best_move, Move last_move=Move::INVALID())
template<Player P>
bool | isWinningState (int node_limit, const NumEffectState &state, const HashKey &key, const PathEncoding &path, Move &best_move, Move last_move=Move::INVALID())
| 詰みを発見.
bool | isWinningState (int node_limit, const NumEffectState &state, const HashKey &key, const PathEncoding &path, Move &best_move, Move last_move=Move::INVALID())
ProofDisproof | findProof (int node_limit, const NumEffectState &state, const HashKey &key, const PathEncoding &path, Move &best_move, Move last_move=Move::INVALID())
template<Player P>
bool | isLosingState (int node_limit, const NumEffectState &state, const HashKey &key, const PathEncoding &path, Move last_move=Move::INVALID())
bool | isLosingState (int node_limit, const NumEffectState &state, const HashKey &key, const PathEncoding &path, Move last_move=Move::INVALID())
void | runGC (bool verbose=false, size_t memory_use_ratio_1000=0)
void | setVerbose (int level=1)
int | distance (Player attack, const HashKey &key)
size_t | mainNodeCount () const
size_t | totalNodeCount () const
void | writeRootHistory (const RepetitionCounter &counter, const MoveStack &moves, const SimpleState &state, Player attack)
const DfpnTable & | table (Player) const
template<osl::Player P>
osl::ProofDisproof | findProof (int node_limit, const NumEffectState &state, const HashKey &key, const PathEncoding &path, Move &best_move, Move last_move)

## Private Member Functions

Dfpn & | prepareDfpn (Player attack)
Dfpn & | prepareDfpnSmall (Player attack)

## Private Attributes

std::shared_ptr< Shared > | shared
std::unique_ptr< Local > | local

## Detailed Description

一般用詰み探索: 先手後手の詰みを別々に管理

Definition at line 28 of file dualDfpn.h.

## Constructor & Destructor Documentation

## DualDfpn() [1/2]

osl::checkmate::DualDfpn::DualDfpn | ( | uint64_t | ignored = std::numeric_limits<uint64_t>::max() | ) |

explicit

Definition at line 263 of file dualDfpn.cc.

References local, and shared.

Referenced by DualDfpn().

## DualDfpn() [2/2]

osl::checkmate::DualDfpn::DualDfpn | ( | const DualDfpn & | src | ) |

Definition at line 269 of file dualDfpn.cc.

References DualDfpn(), local, and shared.

## ~DualDfpn()

osl::checkmate::DualDfpn::~DualDfpn | ( |  | ) |

Definition at line 275 of file dualDfpn.cc.

## Member Function Documentation

## distance()

int osl::checkmate::DualDfpn::distance | ( | Player | attack,
|  | const HashKey & | key )

Definition at line 613 of file dualDfpn.cc.

References prepareDfpn(), and shared.

## findProof() [1/3]

template<osl::Player P>

osl::ProofDisproof osl::checkmate::DualDfpn::findProof | ( | int | node_limit,
|  | const NumEffectState & | state,
|  | const HashKey & | key,
|  | const PathEncoding & | path,
|  | Move & | best_move,
|  | Move | last_move )

Definition at line 377 of file dualDfpn.cc.

References osl::stat::Ratio::add(), osl::BLACK, osl::hash::HashKey128::blackStand(), osl::checkmate::Dfpn::hasCheckmateMove(), osl::NumEffectState::inCheck(), osl::checkmate::ProofDisproof::isCheckmateSuccess(), osl::checkmate::ProofDisproof::isFinal(), osl::checkmate::ProofDisproof::isLoopDetection(), osl::Move::isNormal(), osl::PieceStand::isSuperiorOrEqualTo(), local, local_table_growth_limit, osl::checkmate::ProofDisproof::LoopDetection(), osl::checkmate::Dfpn::nodeCount(), prepareDfpn(), prepareDfpnSmall(), SCOPED_LOCK, shared, osl::checkmate::Dfpn::tryProof(), osl::checkmate::Dfpn::tryProofLight(), osl::SimpleState::turn(), and osl::WHITE.

## findProof() [2/3]

template ProofDisproof osl::checkmate::DualDfpn::findProof< WHITE > | ( | int | node_limit,
|  | const NumEffectState & | state,
|  | const HashKey & | key,
|  | const PathEncoding & | path,
|  | Move & | best_move,
|  | Move | last_move = Move::INVALID() )

Definition at line 479 of file dualDfpn.cc.

References osl::BLACK, findProof(), and osl::SimpleState::turn().

## findProof() [3/3]

template<Player P>

ProofDisproof osl::checkmate::DualDfpn::findProof | ( | int | node_limit,
|  | const NumEffectState & | state,
|  | const HashKey & | key,
|  | const PathEncoding & | path,
|  | Move & | best_move,
|  | Move | last_move = Move::INVALID() )

References osl::Move::INVALID().

Referenced by findProof(), and isWinningState().

## isLosingState() [1/2]

template bool osl::checkmate::DualDfpn::isLosingState< WHITE > | ( | int | node_limit,
|  | const NumEffectState & | state,
|  | const HashKey & | key,
|  | const PathEncoding & | path,
|  | Move | last_move = Move::INVALID() )

Definition at line 565 of file dualDfpn.cc.

References osl::BLACK, isLosingState(), and osl::SimpleState::turn().

## isLosingState() [2/2]

template<osl::Player P>

bool osl::checkmate::DualDfpn::isLosingState | ( | int | node_limit,
|  | const NumEffectState & | state,
|  | const HashKey & | key,
|  | const PathEncoding & | path,
|  | Move | last_move = Move::INVALID() )

Definition at line 550 of file dualDfpn.cc.

References osl::alt(), osl::checkmate::Dfpn::hasEscapeMove(), osl::checkmate::ProofDisproof::isCheckmateSuccess(), local, osl::checkmate::Dfpn::nodeCount(), prepareDfpn(), shared, and osl::SimpleState::turn().

Referenced by isLosingState().

## isWinningState() [1/2]

bool osl::checkmate::DualDfpn::isWinningState | ( | int | node_limit,
|  | const NumEffectState & | state,
|  | const HashKey & | key,
|  | const PathEncoding & | path,
|  | Move & | best_move,
|  | Move | last_move = Move::INVALID() )

Definition at line 490 of file dualDfpn.cc.

References findProof().

## isWinningState() [2/2]

template<Player P>

bool osl::checkmate::DualDfpn::isWinningState | ( | int | node_limit,
|  | const NumEffectState & | state,
|  | const HashKey & | key,
|  | const PathEncoding & | path,
|  | Move & | best_move,
|  | Move | last_move = Move::INVALID() )

inline

詰みを発見.

別々のスレッドから呼び出し可能

Returns
  相手玉が詰み

Definition at line 51 of file dualDfpn.h.

References findProof(), osl::Move::INVALID(), and osl::checkmate::ProofDisproof::isCheckmateSuccess().

## mainNodeCount()

size_t osl::checkmate::DualDfpn::mainNodeCount | ( |  | ) | const

Definition at line 620 of file dualDfpn.cc.

References shared.

## prepareDfpn()

osl::checkmate::Dfpn & osl::checkmate::DualDfpn::prepareDfpn | ( | Player | attack | ) |

private

Definition at line 280 of file dualDfpn.cc.

References local, and shared.

Referenced by distance(), findProof(), isLosingState(), and writeRootHistory().

## prepareDfpnSmall()

osl::checkmate::Dfpn & osl::checkmate::DualDfpn::prepareDfpnSmall | ( | Player | attack | ) |

private

Definition at line 292 of file dualDfpn.cc.

References local, and shared.

Referenced by findProof().

## runGC()

void osl::checkmate::DualDfpn::runGC | ( | bool | verbose = false,
|  | size_t | memory_use_ratio_1000 = 0 )

Definition at line 300 of file dualDfpn.cc.

References osl::BLACK, osl::elapsedSeconds(), local_table_growth_limit, osl::OslConfig::memoryUseLimit(), shared, and osl::WHITE.

## setRootPlayer()

void osl::checkmate::DualDfpn::setRootPlayer | ( | Player | root | ) |

Definition at line 601 of file dualDfpn.cc.

References osl::alt(), and shared.

## setVerbose()

void osl::checkmate::DualDfpn::setVerbose | ( | int | level = 1 | ) |

Definition at line 608 of file dualDfpn.cc.

## table()

const osl::checkmate::DfpnTable & osl::checkmate::DualDfpn::table | ( | Player | attack | ) | const

Definition at line 639 of file dualDfpn.cc.

References shared.

## totalNodeCount()

size_t osl::checkmate::DualDfpn::totalNodeCount | ( |  | ) | const

Definition at line 630 of file dualDfpn.cc.

References shared.

## writeRootHistory()

void osl::checkmate::DualDfpn::writeRootHistory | ( | const RepetitionCounter & | counter,
|  | const MoveStack & | moves,
|  | const SimpleState & | state,
|  | Player | attack )

Definition at line 576 of file dualDfpn.cc.

References osl::RepetitionCounter::checkCount(), osl::container::MoveStack::hasLastMove(), osl::RepetitionCounter::history(), osl::Move::isNormal(), osl::container::MoveStack::lastMove(), prepareDfpn(), osl::PieceStand::previousStand(), osl::checkmate::Dfpn::setIllegal(), shared, osl::hash::HashKeyStack::top(), and osl::WHITE.

## Member Data Documentation

## local

std::unique_ptr<Local> osl::checkmate::DualDfpn::local

private

Definition at line 34 of file dualDfpn.h.

Referenced by DualDfpn(), DualDfpn(), findProof(), isLosingState(), prepareDfpn(), and prepareDfpnSmall().

## shared

std::shared_ptr<Shared> osl::checkmate::DualDfpn::shared

private

Definition at line 33 of file dualDfpn.h.

Referenced by distance(), DualDfpn(), DualDfpn(), findProof(), isLosingState(), mainNodeCount(), prepareDfpn(), prepareDfpnSmall(), runGC(), setRootPlayer(), table(), totalNodeCount(), and writeRootHistory().

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

- dualDfpn.h
- dualDfpn.cc