#include <gameState.h>
Classes | |
| struct | State |
Public Types | |
| enum | MoveType { VALID, PAWN_DROP_FOUL, UNSAFE_KING, OTHER_INVALID } |
Public Member Functions | |
| GameState (const SimpleState &initial_state) | |
| ~GameState () | |
| MoveType | isIllegal (Move m) const |
| const Sennichite | pushMove (Move m, int eval=0) |
| const Move | popMove () |
| bool | canPopMove () const |
| const NumEffectState & | state () const |
| const RepetitionCounter & | counter () const |
| const container::MoveStack & | moveHistory () const |
| const hash::HashKeyStack & | hashHistory () const |
| int | moves () const |
| int | chessMoves () const |
| const SimpleState & | getInitialState () const |
| const boost::shared_ptr < GameState > | clone () const |
| GameState のコピーを作る. 現在の局面を初期局面として扱うため, pushMoveしない限りpopMoveはできない More... | |
| const vector< int > & | evalStack () const |
| void | generateNotLosingMoves (container::MoveVector &normal_or_win_or_draw, container::MoveVector &loss) const |
| void | generateMoves (container::MoveVector &normal_moves, container::MoveVector &win, container::MoveVector &draw, container::MoveVector &loss) const |
| bool | rejectByStack (Move move) const |
Private Member Functions | |
| GameState (const State &src) | |
Private Attributes | |
| boost::scoped_ptr< State > | stack |
State と千日手状態などを一元管理
Definition at line 32 of file gameState.h.
| Enumerator | |
|---|---|
| VALID | |
| PAWN_DROP_FOUL | |
| UNSAFE_KING | |
| OTHER_INVALID | |
Definition at line 42 of file gameState.h.
|
explicitprivate |
Definition at line 44 of file gameState.cc.
Referenced by clone().
|
explicit |
Definition at line 38 of file gameState.cc.
| osl::game_playing::GameState::~GameState | ( | ) |
Definition at line 50 of file gameState.cc.
| bool osl::game_playing::GameState::canPopMove | ( | ) | const |
|
inline |
Definition at line 53 of file gameState.h.
References moves().
| const boost::shared_ptr< osl::game_playing::GameState > osl::game_playing::GameState::clone | ( | ) | const |
GameState のコピーを作る. 現在の局面を初期局面として扱うため, pushMoveしない限りpopMoveはできない
Definition at line 135 of file gameState.cc.
References GameState(), result, and stack.
Referenced by osl::game_playing::SpeculativeSearchPlayer::selectBestMoveCleanUp(), and osl::game_playing::SpeculativeAllMoves::SearchAllMoves::setUp().
| const osl::RepetitionCounter & osl::game_playing::GameState::counter | ( | ) | const |
Definition at line 123 of file gameState.cc.
References stack.
Referenced by osl::game_playing::HistoryToTable::adjustTable(), and osl::game_playing::SearchPlayer::setUpTable().
| const osl::vector< int > & osl::game_playing::GameState::evalStack | ( | ) | const |
Definition at line 148 of file gameState.cc.
References stack.
| void osl::game_playing::GameState::generateMoves | ( | container::MoveVector & | normal_moves, |
| container::MoveVector & | win, | ||
| container::MoveVector & | draw, | ||
| container::MoveVector & | loss | ||
| ) | const |
Definition at line 154 of file gameState.cc.
References osl::alt(), osl::game_playing::GameState::State::counter, osl::move_generator::capture::generate(), osl::checkmate::ImmediateCheckmate::hasCheckmateMove(), osl::Sennichite::hasWinner(), osl::RepetitionCounter::isAlmostSennichite(), isIllegal(), osl::Sennichite::isNormal(), rejectByStack(), result, osl::game_playing::GameState::State::state, VALID, and osl::Sennichite::winner().
Referenced by generateNotLosingMoves().
| void osl::game_playing::GameState::generateNotLosingMoves | ( | container::MoveVector & | normal_or_win_or_draw, |
| container::MoveVector & | loss | ||
| ) | const |
Definition at line 199 of file gameState.cc.
References generateMoves().
Referenced by osl::game_playing::UsiResponse::generateGoodMoves(), and run().
| const osl::state::SimpleState & osl::game_playing::GameState::getInitialState | ( | ) | const |
Definition at line 142 of file gameState.cc.
References stack.
Referenced by osl::game_playing::HistoryToTable::setPV().
| const osl::hash::HashKeyStack & osl::game_playing::GameState::hashHistory | ( | ) | const |
Definition at line 117 of file gameState.cc.
References stack.
Referenced by osl::game_playing::HistoryToTable::adjustTable(), and osl::game_playing::SpeculativeSearchPlayer::selectBestMove().
| osl::game_playing::GameState::MoveType osl::game_playing::GameState::isIllegal | ( | Move | m) | const |
Definition at line 67 of file gameState.cc.
References osl::alt(), OTHER_INVALID, PAWN_DROP_FOUL, stack, osl::game_playing::GameState::State::state, UNSAFE_KING, and VALID.
Referenced by generateMoves(), and osl::game_playing::BookPlayer::moveByBook().
| const osl::MoveStack & osl::game_playing::GameState::moveHistory | ( | ) | const |
Definition at line 111 of file gameState.cc.
References stack.
Referenced by osl::game_playing::HistoryToTable::adjustTable(), osl::game_playing::UsiResponse::genmoveProbability(), rejectByStack(), osl::game_playing::SearchPlayer::saveSearchResult(), osl::game_playing::SearchPlayer::search(), osl::game_playing::SearchPlayer::secondsForThisMove(), osl::game_playing::SpeculativeSearchPlayer::selectBestMove(), osl::game_playing::HistoryToTable::setPV(), and osl::game_playing::SearchPlayer::setUpTable().
| int osl::game_playing::GameState::moves | ( | ) | const |
| const osl::Move osl::game_playing::GameState::popMove | ( | ) |
Definition at line 87 of file gameState.cc.
References canPopMove(), result, and stack.
| const osl::Sennichite osl::game_playing::GameState::pushMove | ( | Move | m, |
| int | eval = 0 |
||
| ) |
Definition at line 55 of file gameState.cc.
References result, stack, and osl::game_playing::GameState::State::state.
Referenced by osl::game_playing::UsiResponse::generateGoodMoves(), osl::game_playing::UsiResponse::genmoveProbability(), main(), and run().
| bool osl::game_playing::GameState::rejectByStack | ( | Move | move) | const |
Definition at line 209 of file gameState.cc.
References osl::alt(), osl::BLACK, osl::RepetitionCounter::checkCount(), osl::game_playing::GameState::State::counter, max_depth, osl::eval::min(), moveHistory(), moves, osl::Move::player(), and osl::game_playing::GameState::State::state.
Referenced by generateMoves().
| const osl::NumEffectState & osl::game_playing::GameState::state | ( | ) | const |
Definition at line 99 of file gameState.cc.
References stack.
Referenced by osl::game_playing::HistoryToTable::adjustTable(), osl::game_playing::UsiResponse::genmoveProbability(), osl::game_playing::AlphaBeta2ProgressEvalPlayer::isReasonableMove(), osl::game_playing::AlphaBeta2OpenMidEndingEvalPlayer::isReasonableMove(), osl::game_playing::AlphaBeta3OpenMidEndingEvalPlayer::isReasonableMove(), osl::game_playing::AlphaBeta4Player::isReasonableMove(), main(), run(), search(), osl::game_playing::SearchPlayer::search(), osl::game_playing::AlphaBeta2ProgressEvalPlayer::searchWithSecondsForThisMove(), osl::game_playing::AlphaBeta2OpenMidEndingEvalPlayer::searchWithSecondsForThisMove(), osl::game_playing::AlphaBeta3OpenMidEndingEvalPlayer::searchWithSecondsForThisMove(), osl::game_playing::AlphaBeta4Player::searchWithSecondsForThisMove(), osl::game_playing::SearchPlayer::secondsForThisMove(), osl::game_playing::RandomPlayer::selectBestMove(), osl::game_playing::SearchPlayer::selectBestMoveInTime(), osl::game_playing::HistoryToTable::setPV(), and osl::game_playing::SearchPlayer::setUpTable().
|
private |
Definition at line 35 of file gameState.h.
Referenced by canPopMove(), clone(), counter(), evalStack(), getInitialState(), hashHistory(), isIllegal(), moveHistory(), moves(), popMove(), pushMove(), and state().
1.8.4