osl::ntesuki::NtesukiMove Class Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

Move に ntesuki 探索に関する情報を加えたもの More...

`#include <ntesukiMove.h>`

Collaboration diagram for osl::ntesuki::NtesukiMove:
[legend]

## Public Member Functions
| NtesukiMove ()
| NtesukiMove (osl::Move m)
| NtesukiMove (osl::Move m, Flags f)
| NtesukiMove (const NtesukiMove &)
| ~NtesukiMove ()
NtesukiMove | operator= (const NtesukiMove &)
void | setCheck ()
bool | isCheck () const
void | setOrder (int o)
int | getOrder () const
void | setInterpose ()
bool | isInterpose () const
void | setLameLong ()
bool | isLameLong () const
void | setBySimulation ()
bool | isBySimulation () const
void | setNoPromote ()
bool | isNoPromote () const
void | setToOld ()
bool | isToOld () const
template<Player P>
void | setImmediateCheckmate ()
bool | isImmediateCheckmate () const
template<Player P>
void | setCheckmateSuccess (int pass_left)
template<Player P>
bool | isCheckmateSuccess (int pass_left) const
bool | isCheckmateSuccessSlow (Player P, int pass_left) const
template<Player P>
void | setCheckmateFail (int pass_left)
template<Player P>
bool | isCheckmateFail (int pass_left) const
bool | isCheckmateFailSlow (Player P, int pass_left) const
void | setPawnDropCheckmate ()
bool | isPawnDropCheckmate () const
void | setHEstimates (unsigned short p_a, unsigned short d_a, unsigned short p_d, unsigned short d_d)
void | setCEstimates (unsigned short p, unsigned short d)
bool | isValid () const
bool | isInvalid () const
bool | isNormal () const
bool | isPass () const
bool | isDrop () const
Square | to () const
Ptype | ptype () const
Move | getMove () const
bool | operator== (const NtesukiMove &rhs) const
bool | operator!= (const NtesukiMove &rhs) const
void | flagsToStream (std::ostream &os) const

## Static Public Member Functions
static NtesukiMove | INVALID ()

## Public Attributes
unsigned short | h_a_proof
unsigned short | h_a_disproof
unsigned short | h_d_proof
unsigned short | h_d_disproof

## Private Types
enum | Flags { NONE = 0, CHECK_FLAG = 1, PAWN_DROP_CHECKMATE_FLAG = 2, IMMEDIATE_CHECKMATE = 8, TO_OLDER_CHILD = 16, NOPROMOTE = 32, INTERPOSE = 64, ATTACK_FLAG = 128, BY_SIMULATION = 256, LAME_LONG = 512, WHITE_SHIFT = 4, IS_SUCCESS_SHIFT = 16, IS_SUCCESS_BLACK_SHIFT = IS_SUCCESS_SHIFT, IS_SUCCESS_WHITE_SHIFT = IS_SUCCESS_SHIFT + WHITE_SHIFT, IS_SUCCESS_BLACK_BASE = 1 << IS_SUCCESS_BLACK_SHIFT, IS_SUCCESS_WHITE_BASE = 1 << IS_SUCCESS_WHITE_SHIFT, IS_SUCCESS_BLACK_MASK = 0xf * IS_SUCCESS_BLACK_BASE, IS_SUCCESS_WHITE_MASK = 0xf * IS_SUCCESS_WHITE_BASE, IS_FAIL_SHIFT = 24, IS_FAIL_BLACK_SHIFT = IS_FAIL_SHIFT, IS_FAIL_WHITE_SHIFT = IS_FAIL_SHIFT + WHITE_SHIFT, IS_FAIL_BLACK_BASE = 1 << IS_FAIL_SHIFT, IS_FAIL_WHITE_BASE = 1 << (IS_FAIL_SHIFT + WHITE_SHIFT), IS_FAIL_BLACK_MASK = 0xf * IS_FAIL_BLACK_BASE, IS_FAIL_WHITE_MASK = 0xfLL * IS_FAIL_WHITE_BASE }

## Private Member Functions
template<Player P>
int | is_success_flag (int pass_left) const
template<Player P>
int | is_fail_flag (int pass_left) const

## Private Attributes
osl::Move | move
int | flags
int | order

## Static Private Attributes
static std::string | FlagsStr []

## Friends
std::ostream & | operator<< (std::ostream &os, const NtesukiMove &move)

## Detailed Description

Move に ntesuki 探索に関する情報を加えたもの

- flag にノードの状態を保持するようにした

Definition at line 18 of file ntesukiMove.h.

## Member Enumeration Documentation

enum osl::ntesuki::NtesukiMove::Flags
| private

Enumerator
NONE |
CHECK_FLAG |
PAWN_DROP_CHECKMATE_FLAG | If this move is a check move.
IMMEDIATE_CHECKMATE | If this move is a pawn drop checkmate foul.
TO_OLDER_CHILD | If this move is an immidiate checkmate.
NOPROMOTE | If the distance of the parent is larger than the child.
INTERPOSE | A promotable PAWN,ROOK,BISHOP move without promotion.
ATTACK_FLAG | Aigoma.
BY_SIMULATION | Attack move candidate.
LAME_LONG | Value of the node after this move determined by simulation.
WHITE_SHIFT |
IS_SUCCESS_SHIFT |
IS_SUCCESS_BLACK_SHIFT | This move leads to checkmate success.
IS_SUCCESS_WHITE_SHIFT |
IS_SUCCESS_BLACK_BASE |
IS_SUCCESS_WHITE_BASE |
IS_SUCCESS_BLACK_MASK |
IS_SUCCESS_WHITE_MASK |
IS_FAIL_SHIFT |
IS_FAIL_BLACK_SHIFT | This move leads to checkmate fail.
IS_FAIL_WHITE_SHIFT |
IS_FAIL_BLACK_BASE |
IS_FAIL_WHITE_BASE |
IS_FAIL_BLACK_MASK |
IS_FAIL_WHITE_MASK |

Definition at line 20 of file ntesukiMove.h.

## Constructor & Destructor Documentation

osl::ntesuki::NtesukiMove::NtesukiMove | ( | ) |  |

Definition at line 11 of file ntesukiMove.cc.

osl::ntesuki::NtesukiMove::NtesukiMove | ( | osl::Move | m) |  |

Definition at line 15 of file ntesukiMove.cc.

osl::ntesuki::NtesukiMove::NtesukiMove | ( | osl::Move | m,
|  | Flags | f
| ) |  |

Definition at line 22 of file ntesukiMove.cc.

osl::ntesuki::NtesukiMove::NtesukiMove | ( | const NtesukiMove & | m) |  |

Definition at line 29 of file ntesukiMove.cc.

osl::ntesuki::NtesukiMove::~NtesukiMove | ( | ) |  |

Definition at line 53 of file ntesukiMove.cc.

## Member Function Documentation

void osl::ntesuki::NtesukiMove::flagsToStream | ( | std::ostream & | os) |  | const

Definition at line 235 of file ntesukiMove.cc.

References FlagsStr.

osl::Move osl::ntesuki::NtesukiMove::getMove | ( | ) |  | const

Definition at line 219 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiMoveList::add(), osl::ntesuki::NtesukiTable::allocateWithMove(), osl::ntesuki::NtesukiSimulationSearcher::attackForDisproof(), osl::ntesuki::NtesukiSimulationSearcher::attackForProof(), osl::ntesuki::NtesukiSearcher::attackWithOrder(), osl::ntesuki::NtesukiRecord::calcProofPiecesOr(), osl::ntesuki::NtesukiSimulationSearcher::defenseForProof(), osl::ntesuki::NtesukiSearcher::defenseWithPlayer(), osl::ntesuki::NtesukiMoveList::find(), osl::ntesuki::NtesukiTable::findWithMove(), osl::ntesuki::NtesukiTable::findWithMoveConst(), osl::ntesuki::NtesukiTable::Table::forEachRecordFrom(), RecordPrinter2::noChildMove(), RecordPrinter::operator()(), RecordPrinter::Compare::operator()(), RecordPrinter2::operator()(), RecordPrinter2::Compare::operator()(), MarkAndSweep::Compare::operator()(), DifferentMove::operator()(), osl::ntesuki::NtesukiSearcher::selectMoveAttack(), osl::ntesuki::NtesukiSearcher::selectMoveDefense(), osl::ntesuki::NtesukiRecord::setDisproofPieces(), osl::ntesuki::NtesukiSearcher::simulateSiblingsFail(), osl::ntesuki::NtesukiSearcher::simulateSiblingsSuccess(), RecordPrinter::withChildMove(), and RecordPrinter2::withChildMove().

int osl::ntesuki::NtesukiMove::getOrder | ( | ) |  | const

Definition at line 83 of file ntesukiMove.cc.

References order.

Referenced by osl::ntesuki::NtesukiSearcher::selectMoveAttack().

osl::ntesuki::NtesukiMove osl::ntesuki::NtesukiMove::INVALID | ( | ) |  |
| static

Definition at line 59 of file ntesukiMove.cc.

References osl::Move::INVALID().

Referenced by osl::ntesuki::NtesukiRecord::setUpAttackNode(), and osl::ntesuki::NtesukiRecord::setUpDefenseNode().

template<osl::Player P>

int osl::ntesuki::NtesukiMove::is_fail_flag | ( | int | pass_left) |  | const
| private

Definition at line 32 of file ntesukiMove.tcc.

References osl::BLACK, and ntesuki_assert.

template<osl::Player P>

int osl::ntesuki::NtesukiMove::is_success_flag | ( | int | pass_left) |  | const
| private

Definition at line 20 of file ntesukiMove.tcc.

References osl::BLACK, ntesuki_assert, and osl::WHITE.

bool osl::ntesuki::NtesukiMove::isBySimulation | ( | ) |  | const

Definition at line 156 of file ntesukiMove.cc.

bool osl::ntesuki::NtesukiMove::isCheck | ( | ) |  | const

Definition at line 70 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiMoveList::add(), osl::ntesuki::OracleProverLight::attack(), osl::ntesuki::NtesukiSimulationSearcher::attackForDisproof(), osl::ntesuki::NtesukiSimulationSearcher::attackForProof(), osl::ntesuki::NtesukiSearcher::attackWithOrder(), osl::ntesuki::NtesukiRecord::calcProofPiecesAnd(), osl::ntesuki::OracleProverLight::defense(), osl::ntesuki::NtesukiSimulationSearcher::defenseForProof(), osl::ntesuki::NtesukiSearcher::defenseWithPlayer(), osl::ntesuki::NtesukiSearcher::selectMoveAttack(), and osl::ntesuki::NtesukiSearcher::selectMoveDefense().

template<osl::Player P>

bool osl::ntesuki::NtesukiMove::isCheckmateFail | ( | int | pass_left) |  | const

Definition at line 71 of file ntesukiMove.tcc.

Referenced by osl::ntesuki::NtesukiSimulationSearcher::attackForDisproof(), osl::ntesuki::NtesukiSearcher::defenseWithPlayer(), osl::ntesuki::NtesukiSearcher::selectMoveAttack(), osl::ntesuki::NtesukiSearcher::selectMoveDefense(), and osl::ntesuki::NtesukiSearcher::simulateSiblingsFail().

bool osl::ntesuki::NtesukiMove::isCheckmateFailSlow | ( | Player | P,
|  | int | pass_left
| ) |  | const

Definition at line 195 of file ntesukiMove.cc.

References osl::BLACK.

template<osl::Player P>

bool osl::ntesuki::NtesukiMove::isCheckmateSuccess | ( | int | pass_left) |  | const

Definition at line 54 of file ntesukiMove.tcc.

Referenced by osl::ntesuki::NtesukiSearcher::attackWithOrder(), osl::ntesuki::NtesukiSimulationSearcher::defenseForProof(), and osl::ntesuki::NtesukiSearcher::selectMoveDefense().

bool osl::ntesuki::NtesukiMove::isCheckmateSuccessSlow | ( | Player | P,
|  | int | pass_left
| ) |  | const

Definition at line 186 of file ntesukiMove.cc.

References osl::BLACK.

bool osl::ntesuki::NtesukiMove::isDrop | ( | ) |  | const

Definition at line 213 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiRecord::calcProofPiecesOr(), osl::ntesuki::NtesukiTable::findWithMove(), osl::ntesuki::NtesukiTable::findWithMoveConst(), and osl::ntesuki::NtesukiRecord::setDisproofPieces().

bool osl::ntesuki::NtesukiMove::isImmediateCheckmate | ( | ) |  | const

Definition at line 144 of file ntesukiMove.cc.

Referenced by osl::ntesuki::OracleProverLight::attack(), osl::ntesuki::NtesukiSimulationSearcher::attackForProof(), osl::ntesuki::OracleProverLight::startFromAttack(), osl::ntesuki::NtesukiSimulationSearcher::startFromAttackProof(), and osl::ntesuki::NtesukiSimulationSearcher::startFromDefenseProof().

bool osl::ntesuki::NtesukiMove::isInterpose | ( | ) |  | const

Definition at line 110 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiSearcher::selectMoveDefense().

bool osl::ntesuki::NtesukiMove::isInvalid | ( | ) |  | const

Definition at line 207 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiSearcher::attack(), osl::ntesuki::NtesukiSimulationSearcher::attackForDisproof(), osl::ntesuki::NtesukiSimulationSearcher::attackForProof(), osl::ntesuki::NtesukiSearcher::attackWithOrder(), osl::ntesuki::NtesukiSearcher::defense(), osl::ntesuki::NtesukiSimulationSearcher::defenseForDisproof(), and osl::ntesuki::NtesukiSearcher::handleInterpose().

bool osl::ntesuki::NtesukiMove::isLameLong | ( | ) |  | const

Definition at line 123 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiSearcher::selectMoveAttack(), and osl::ntesuki::NtesukiSearcher::selectMoveDefense().

bool osl::ntesuki::NtesukiMove::isNoPromote | ( | ) |  | const

Definition at line 97 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiSimulationSearcher::attackForDisproof(), osl::ntesuki::NtesukiRecord::calcProofPiecesAnd(), and osl::ntesuki::NtesukiSearcher::selectMoveAttack().

bool osl::ntesuki::NtesukiMove::isNormal | ( | ) |  | const

Definition at line 209 of file ntesukiMove.cc.

Referenced by osl::ntesuki::OracleProverLight::defense(), osl::ntesuki::NtesukiTable::findWithMove(), and osl::ntesuki::NtesukiTable::findWithMoveConst().

bool osl::ntesuki::NtesukiMove::isPass | ( | ) |  | const

Definition at line 211 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiTable::allocateWithMove(), osl::ntesuki::NtesukiSimulationSearcher::attackForDisproof(), osl::ntesuki::OracleProverLight::defense(), osl::ntesuki::NtesukiSimulationSearcher::defenseForProof(), osl::ntesuki::NtesukiSearcher::defenseWithPlayer(), osl::ntesuki::NtesukiSearcher::selectMoveAttack(), osl::ntesuki::NtesukiSearcher::selectMoveDefense(), osl::ntesuki::NtesukiRecord::setDisproofPieces(), osl::ntesuki::NtesukiRecord::setProofPieces(), RecordPrinter::withChildMove(), and RecordPrinter2::withChildMove().

bool osl::ntesuki::NtesukiMove::isPawnDropCheckmate | ( | ) |  | const

Definition at line 170 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiSearcher::selectMoveAttack().

bool osl::ntesuki::NtesukiMove::isToOld | ( | ) |  | const

Definition at line 135 of file ntesukiMove.cc.

bool osl::ntesuki::NtesukiMove::isValid | ( | ) |  | const

Definition at line 205 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiSimulationSearcher::attackForProof(), osl::ntesuki::NtesukiRecord::setDisproofPieces(), osl::ntesuki::NtesukiRecord::setProofPieces(), osl::ntesuki::NtesukiRecord::setResult(), and osl::ntesuki::OracleProverLight::startFromAttack().

bool osl::ntesuki::NtesukiMove::operator!= | ( | const NtesukiMove & | rhs) |  | const

Definition at line 228 of file ntesukiMove.cc.

References move.

osl::ntesuki::NtesukiMove osl::ntesuki::NtesukiMove::operator= | ( | const NtesukiMove & | m) |  |

Definition at line 37 of file ntesukiMove.cc.

References flags, h_a_disproof, h_a_proof, h_d_disproof, h_d_proof, move, order, and order.

bool osl::ntesuki::NtesukiMove::operator== | ( | const NtesukiMove & | rhs) |  | const

Definition at line 223 of file ntesukiMove.cc.

References move.

osl::Ptype osl::ntesuki::NtesukiMove::ptype | ( | ) |  | const

Definition at line 217 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiRecord::calcProofPiecesOr(), and osl::ntesuki::NtesukiRecord::setDisproofPieces().

void osl::ntesuki::NtesukiMove::setBySimulation | ( | ) |  |

Definition at line 150 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiSearcher::defenseWithPlayer(), osl::ntesuki::NtesukiSearcher::simulateSiblingsFail(), and osl::ntesuki::NtesukiSearcher::simulateSiblingsSuccess().

void osl::ntesuki::NtesukiMove::setCEstimates | ( | unsigned short | p,
|  | unsigned short | d
| ) |  |

void osl::ntesuki::NtesukiMove::setCheck | ( | ) |  |

Definition at line 63 of file ntesukiMove.cc.

References ntesuki_assert.

Referenced by osl::ntesuki::NtesukiMoveList::NtesukiMoveList(), and osl::ntesuki::NtesukiRecord::setUpAttackNode().

template<osl::Player P>

template void osl::ntesuki::NtesukiMove::setCheckmateFail< WHITE > | ( | int | pass_left) |  |

Definition at line 61 of file ntesukiMove.tcc.

References ntesuki_assert.

Referenced by osl::ntesuki::NtesukiSimulationSearcher::attackForDisproof(), osl::ntesuki::NtesukiSearcher::attackWithOrder(), osl::ntesuki::NtesukiSearcher::defenseWithPlayer(), osl::ntesuki::NtesukiSearcher::selectMoveAttack(), osl::ntesuki::NtesukiSearcher::selectMoveDefense(), and osl::ntesuki::NtesukiSearcher::simulateSiblingsFail().

template<osl::Player P>

template void osl::ntesuki::NtesukiMove::setCheckmateSuccess< WHITE > | ( | int | pass_left) |  |

Definition at line 45 of file ntesukiMove.tcc.

References ntesuki_assert.

Referenced by osl::ntesuki::NtesukiSimulationSearcher::attackForProof(), osl::ntesuki::NtesukiSearcher::attackWithOrder(), osl::ntesuki::NtesukiSearcher::defenseWithPlayer(), osl::ntesuki::NtesukiSearcher::selectMoveAttack(), osl::ntesuki::NtesukiSearcher::selectMoveDefense(), and osl::ntesuki::NtesukiSearcher::simulateSiblingsSuccess().

void osl::ntesuki::NtesukiMove::setHEstimates | ( | unsigned short | p_a,
|  | unsigned short | d_a,
|  | unsigned short | p_d,
|  | unsigned short | d_d
| ) |  |

Definition at line 176 of file ntesukiMove.cc.

template<osl::Player P>

template void osl::ntesuki::NtesukiMove::setImmediateCheckmate< WHITE > | ( | ) |  |

Definition at line 8 of file ntesukiMove.tcc.

References osl::BLACK, flags, IMMEDIATE_CHECKMATE, IS_SUCCESS_BLACK_MASK, and IS_SUCCESS_WHITE_MASK.

Referenced by osl::ntesuki::NtesukiRecord::setUpAttackNode().

void osl::ntesuki::NtesukiMove::setInterpose | ( | ) |  |

Definition at line 103 of file ntesukiMove.cc.

References ntesuki_assert.

void osl::ntesuki::NtesukiMove::setLameLong | ( | ) |  |

Definition at line 116 of file ntesukiMove.cc.

References ntesuki_assert.

void osl::ntesuki::NtesukiMove::setNoPromote | ( | ) |  |

Definition at line 90 of file ntesukiMove.cc.

References ntesuki_assert.

void osl::ntesuki::NtesukiMove::setOrder | ( | int | o) |  |

Definition at line 76 of file ntesukiMove.cc.

References ntesuki_assert, and order.

void osl::ntesuki::NtesukiMove::setPawnDropCheckmate | ( | ) |  |

Definition at line 164 of file ntesukiMove.cc.

Referenced by osl::ntesuki::NtesukiSearcher::attackWithOrder(), and osl::ntesuki::NtesukiSearcher::selectMoveAttack().

void osl::ntesuki::NtesukiMove::setToOld | ( | ) |  |

Definition at line 129 of file ntesukiMove.cc.

osl::Square osl::ntesuki::NtesukiMove::to | ( | ) |  | const

Definition at line 215 of file ntesukiMove.cc.

## Friends And Related Function Documentation

std::ostream& operator<< | ( | std::ostream & | os,
|  | const NtesukiMove & | move
| ) |  |
| friend

## Member Data Documentation

int osl::ntesuki::NtesukiMove::flags
| private

Definition at line 77 of file ntesukiMove.h.

Referenced by operator=(), and setImmediateCheckmate().

std::string osl::ntesuki::NtesukiMove::FlagsStr
| staticprivate

Definition at line 70 of file ntesukiMove.h.

Referenced by flagsToStream().

unsigned short osl::ntesuki::NtesukiMove::h_a_disproof

Definition at line 80 of file ntesukiMove.h.

Referenced by RecordPrinter2::noChildMove(), operator=(), and osl::ntesuki::NtesukiSearcher::selectMoveAttack().

unsigned short osl::ntesuki::NtesukiMove::h_a_proof

Definition at line 80 of file ntesukiMove.h.

Referenced by RecordPrinter2::noChildMove(), operator=(), and osl::ntesuki::NtesukiSearcher::selectMoveAttack().

unsigned short osl::ntesuki::NtesukiMove::h_d_disproof

Definition at line 81 of file ntesukiMove.h.

Referenced by RecordPrinter2::noChildMove(), operator=(), and osl::ntesuki::NtesukiSearcher::selectMoveDefense().

unsigned short osl::ntesuki::NtesukiMove::h_d_proof

Definition at line 81 of file ntesukiMove.h.

Referenced by RecordPrinter2::noChildMove(), operator=(), and osl::ntesuki::NtesukiSearcher::selectMoveDefense().

osl::Move osl::ntesuki::NtesukiMove::move
| private

Definition at line 76 of file ntesukiMove.h.

Referenced by osl::ntesuki::OracleProverLight::attack(), osl::ntesuki::OracleProverLight::defense(), operator!=(), operator=(), and operator==().

int osl::ntesuki::NtesukiMove::order
| private

Definition at line 78 of file ntesukiMove.h.

Referenced by operator=().

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

- ntesukiMove.h
- ntesukiMove.tcc
- ntesukiMove.cc