osl::search::ThreatmateState 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 Types | Public Member Functions | Static Private Attributes | Friends | List of all members
osl::search::ThreatmateState Class Reference

詰めろを考慮した詰将棋探索のための状態管理. More...

`#include <threatmateState.h>`

Inheritance diagram for osl::search::ThreatmateState:
[legend]
Collaboration diagram for osl::search::ThreatmateState:
[legend]

## Public Types
enum | Status { UNKNOWN = 0, THREATMATE, MAYBE_THREATMATE, CHECK_AFTER_THREATMATE, MAY_HAVE_CHECKMATE }

## Public Member Functions
| ThreatmateState (Status s=UNKNOWN)
void | setThreatmate (Status s)
bool | isUnknown () const
bool | isThreatmate () const
bool | maybeThreatmate () const
bool | mayHaveCheckmate () const
Status | status () const
const ThreatmateState | newStatus (bool is_check) const
void | update (const ThreatmateState *parent, bool in_check)

## Static Private Attributes
static const CArray< Status, 5 *2 > | transition

## Friends
class | DualThreatmateState

## Additional Inherited Members
Protected Attributes inherited from osl::search::ThreatmateStateData
char | current_status

## Detailed Description

詰めろを考慮した詰将棋探索のための状態管理.

http://www31.ocn.ne.jp/~kfend/inside_kfend/ptc.html#c3

- (MAYBE_)THREATMATE –(check)–> CHECK_AFTER_THREATMATE
- (MAYBE_)THREATMATE –(no-check)–> MAY_HAVE_CHECKMATE
- CHECK_AFTER_THREATMATE –(escape)–> MAYBE_THREATMATE

Definition at line 29 of file threatmateState.h.

## Member Enumeration Documentation

enum osl::search::ThreatmateState::Status

Enumerator
UNKNOWN |
THREATMATE | threatmate found by checkmate search
MAYBE_THREATMATE | threatmate, not sure
CHECK_AFTER_THREATMATE | status after threatmate responded by check
MAY_HAVE_CHECKMATE | status after threatmate responded by non-check move

Definition at line 33 of file threatmateState.h.

## Constructor & Destructor Documentation

osl::search::ThreatmateState::ThreatmateState | ( | Status | s = `UNKNOWN`) |  |
| inline

Definition at line 47 of file threatmateState.h.

References osl::search::ThreatmateStateData::current_status.

## Member Function Documentation

bool osl::search::ThreatmateState::isThreatmate | ( | ) |  | const
| inline

Definition at line 57 of file threatmateState.h.

References osl::search::ThreatmateStateData::current_status, and THREATMATE.

Referenced by osl::search::DualThreatmateState::isThreatmate().

bool osl::search::ThreatmateState::isUnknown | ( | ) |  | const
| inline

Definition at line 54 of file threatmateState.h.

References osl::search::ThreatmateStateData::current_status, and UNKNOWN.

bool osl::search::ThreatmateState::maybeThreatmate | ( | ) |  | const
| inline

Definition at line 60 of file threatmateState.h.

References osl::search::ThreatmateStateData::current_status, MAYBE_THREATMATE, and THREATMATE.

Referenced by osl::search::DualThreatmateState::maybeThreatmate(), and update().

bool osl::search::ThreatmateState::mayHaveCheckmate | ( | ) |  | const
| inline

Definition at line 64 of file threatmateState.h.

References osl::search::ThreatmateStateData::current_status, and MAY_HAVE_CHECKMATE.

Referenced by osl::search::DualThreatmateState::mayHaveCheckmate().

const ThreatmateState osl::search::ThreatmateState::newStatus | ( | bool | is_check) |  | const
| inline

Definition at line 70 of file threatmateState.h.

References osl::search::ThreatmateStateData::current_status, and transition.

Referenced by update().

void osl::search::ThreatmateState::setThreatmate | ( | Status | s) |  |
| inline

Definition at line 51 of file threatmateState.h.

References osl::search::ThreatmateStateData::current_status.

Referenced by osl::search::DualThreatmateState::setThreatmate().

Status osl::search::ThreatmateState::status | ( | ) |  | const
| inline

Definition at line 67 of file threatmateState.h.

References osl::search::ThreatmateStateData::current_status.

Referenced by osl::search::AlphaBeta2Tree< EvalT >::alphaBetaSearchAfterMove(), and osl::search::operator<<().

void osl::search::ThreatmateState::update | ( | const ThreatmateState * | parent,
|  | bool | in_check
| ) |  |
| inline

Definition at line 75 of file threatmateState.h.

References maybeThreatmate(), and newStatus().

Referenced by osl::search::DualThreatmateState::updateInLock().

## Friends And Related Function Documentation

friend class DualThreatmateState
| friend

Definition at line 31 of file threatmateState.h.

## Member Data Documentation

const osl::CArray< osl::search::ThreatmateState::Status, 5 *2 > osl::search::ThreatmateState::transition
| staticprivate

Initial value:
= {{
UNKNOWN, UNKNOWN,
MAY_HAVE_CHECKMATE, CHECK_AFTER_THREATMATE,
MAY_HAVE_CHECKMATE, CHECK_AFTER_THREATMATE,
MAYBE_THREATMATE, UNKNOWN,
UNKNOWN, UNKNOWN,
}}

Definition at line 45 of file threatmateState.h.

Referenced by newStatus().

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

- threatmateState.h
- threatmateState.cc