dfpnRecord.h
Go to the documentation of this file.
/* dfpnRecord.h
*/
#ifndef OSL_DFPNRECORD_H
#define OSL_DFPNRECORD_H
#include "osl/checkmate/proofDisproof.h"
#include "osl/basic_type.h"
#define NAGAI_DAG_TEST
namespace osl
{
namespace checkmate
{
struct DfpnRecordBase
{
ProofDisproof proof_disproof;
uint64_t solved;
#ifdef NAGAI_DAG_TEST
uint64_t dag_moves;
#endif
Move best_move;
PieceStand proof_pieces;
mutable unsigned int node_count;
unsigned int tried_oracle;
Move last_move;
PieceStand proof_pieces_candidate;
unsigned int min_pdp; // solved のmin
uint32_t working_threads;
Square last_to;
enum ProofPiecesType { UNSET=0, PROOF, DISPROOF };
int8_t proof_pieces_set;
char need_full_width, false_branch;
#ifdef NAGAI_DAG_TEST
bool dag_terminal;
#endif
DfpnRecordBase()
: solved(0),
#ifdef NAGAI_DAG_TEST
dag_moves(0),
#endif
node_count(0), tried_oracle(0), min_pdp(ProofDisproof::PROOF_MAX),
working_threads(0),
proof_pieces_set(UNSET), need_full_width(false), false_branch(false)
#ifdef NAGAI_DAG_TEST
, dag_terminal(0)
#endif
{
}
};
class DfpnRecord : public DfpnRecordBase
{
public:
CArray<PieceStand,2> stands;
DfpnRecord() {}
DfpnRecord(PieceStand black, PieceStand white) { stands[BLACK] = black; stands[WHITE] = white; }
void setFrom(const DfpnRecordBase& src)
{
static_cast<DfpnRecordBase*>(this)->operator=(src);
node_count = 1;
solved = 0;
last_to = Square();
last_move = Move();
need_full_width = false_branch = false;
#ifdef NAGAI_DAG_TEST
dag_moves = 0;
dag_terminal = false;
#endif
}
unsigned int proof() const { return proof_disproof.proof(); }
unsigned int disproof() const { return proof_disproof.disproof(); }
void setProofPieces(PieceStand a)
{
assert(proof_pieces_set == UNSET);
assert((stands[BLACK] == PieceStand() && stands[WHITE] == PieceStand())
|| stands[BLACK].isSuperiorOrEqualTo(a)
|| stands[WHITE].isSuperiorOrEqualTo(a));
proof_pieces_set = PROOF;
proof_pieces = a;
}
void setDisproofPieces(PieceStand a)
{
assert(proof_pieces_set == UNSET);
assert((stands[BLACK] == PieceStand() && stands[WHITE] == PieceStand())
|| stands[BLACK].isSuperiorOrEqualTo(a)
|| stands[WHITE].isSuperiorOrEqualTo(a));
proof_pieces_set = DISPROOF;
proof_pieces = a;
}
const PieceStand proofPieces() const
{
assert(proof_pieces_set == PROOF);
return proof_pieces;
}
const PieceStand disproofPieces() const
{
assert(proof_pieces_set == DISPROOF);
return proof_pieces;
}
};
}
}
#endif /* OSL_DFPNRECORD_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
basic_type.h
osl::CArray
Definition container.h:20
osl::Move
圧縮していない moveの表現 .
Definition basic_type.h:1052
osl::PieceStand
片方の手番の持駒の枚数を記録するクラス.
Definition bits/pieceStand.h:38
osl::Square
Definition basic_type.h:532
osl::checkmate::DfpnRecord::disproofPieces
const PieceStand disproofPieces() const
Definition dfpnRecord.h:103
osl::checkmate::DfpnRecord::stands
CArray< PieceStand, 2 > stands
Definition dfpnRecord.h:60
osl::checkmate::DfpnRecord::DfpnRecord
DfpnRecord()
Definition dfpnRecord.h:62
osl::checkmate::DfpnRecord::disproof
unsigned int disproof() const
Definition dfpnRecord.h:79
osl::checkmate::DfpnRecord::setFrom
void setFrom(const DfpnRecordBase &src)
Definition dfpnRecord.h:65
osl::checkmate::DfpnRecord::proof
unsigned int proof() const
Definition dfpnRecord.h:78
osl::checkmate::DfpnRecord::proofPieces
const PieceStand proofPieces() const
Definition dfpnRecord.h:98
osl::checkmate::DfpnRecord::setDisproofPieces
void setDisproofPieces(PieceStand a)
Definition dfpnRecord.h:89
osl::checkmate::DfpnRecord::setProofPieces
void setProofPieces(PieceStand a)
Definition dfpnRecord.h:80
osl::checkmate::DfpnRecord::DfpnRecord
DfpnRecord(PieceStand black, PieceStand white)
Definition dfpnRecord.h:63
osl::checkmate::ProofDisproof
証明数(proof number)と反証数(disproof number).
Definition proofDisproof.h:17
NAGAI_DAG_TEST
#define NAGAI_DAG_TEST
Definition dfpnRecord.h:9
osl
Definition additionalEffect.h:6
osl::WHITE
@ WHITE
Definition basic_type.h:10
osl::BLACK
@ BLACK
Definition basic_type.h:9
proofDisproof.h
osl::checkmate::DfpnRecordBase::ProofPiecesType
ProofPiecesType
Definition dfpnRecord.h:35
osl::checkmate::DfpnRecordBase::PROOF
@ PROOF
Definition dfpnRecord.h:35
osl::checkmate::DfpnRecordBase::DISPROOF
@ DISPROOF
Definition dfpnRecord.h:35
osl::checkmate::DfpnRecordBase::UNSET
@ UNSET
Definition dfpnRecord.h:35
osl::checkmate::DfpnRecordBase::node_count
unsigned int node_count
Definition dfpnRecord.h:26
osl::checkmate::DfpnRecordBase::min_pdp
unsigned int min_pdp
Definition dfpnRecord.h:32
osl::checkmate::DfpnRecordBase::dag_terminal
bool dag_terminal
Definition dfpnRecord.h:39
osl::checkmate::DfpnRecordBase::proof_disproof
ProofDisproof proof_disproof
Definition dfpnRecord.h:17
osl::checkmate::DfpnRecordBase::need_full_width
char need_full_width
Definition dfpnRecord.h:37
osl::checkmate::DfpnRecordBase::proof_pieces_candidate
PieceStand proof_pieces_candidate
solved のmax
Definition dfpnRecord.h:31
osl::checkmate::DfpnRecordBase::tried_oracle
unsigned int tried_oracle
Definition dfpnRecord.h:27
osl::checkmate::DfpnRecordBase::proof_pieces
PieceStand proof_pieces
Definition dfpnRecord.h:25
osl::checkmate::DfpnRecordBase::DfpnRecordBase
DfpnRecordBase()
Definition dfpnRecord.h:42
osl::checkmate::DfpnRecordBase::proof_pieces_set
int8_t proof_pieces_set
Definition dfpnRecord.h:36
osl::checkmate::DfpnRecordBase::solved
uint64_t solved
手番に否定的に結果が判明したリスト loop は除く
Definition dfpnRecord.h:19
osl::checkmate::DfpnRecordBase::best_move
Move best_move
Definition dfpnRecord.h:24
osl::checkmate::DfpnRecordBase::last_to
Square last_to
Definition dfpnRecord.h:34
osl::checkmate::DfpnRecordBase::working_threads
uint32_t working_threads
Definition dfpnRecord.h:33
osl::checkmate::DfpnRecordBase::false_branch
char false_branch
Definition dfpnRecord.h:37
osl::checkmate::DfpnRecordBase::last_move
Move last_move
合流検知+simulation中の簡易 無限ループ回避
Definition dfpnRecord.h:29
osl::checkmate::DfpnRecordBase::dag_moves
uint64_t dag_moves
合流を引き起こす指手一覧
Definition dfpnRecord.h:22