Go to the documentation of this file.00001
00002
00003 #ifndef OSL_ANNOTATE_ANALYSESRESULT_H
00004 #define OSL_ANNOTATE_ANALYSESRESULT_H
00005
00006 #include "osl/move.h"
00007 #include "osl/piece.h"
00008 #include "osl/stl/vector.h"
00009 #include <iosfwd>
00010
00011 namespace osl
00012 {
00013 namespace annotate
00014 {
00015 enum Trivalent { Unknown=0, True=1, False=-1 };
00016 struct AnalysesResult
00017 {
00018 struct CheckmateForCapture
00019 {
00020 int safe_count, checkmate_count, see_plus_checkmate_count;
00021 CheckmateForCapture()
00022 : safe_count(0), checkmate_count(0), see_plus_checkmate_count(0)
00023 {
00024 }
00025 bool operator==(const CheckmateForCapture& r) const
00026 {
00027 return safe_count == r.safe_count
00028 && checkmate_count == r.checkmate_count
00029 && see_plus_checkmate_count == r.see_plus_checkmate_count;
00030 }
00031 };
00032 struct CheckmateForEscape
00033 {
00034 int safe_count, checkmate_count;
00035 CheckmateForEscape() : safe_count(0), checkmate_count(0)
00036 {
00037 }
00038 bool operator==(const CheckmateForEscape& r) const
00039 {
00040 return safe_count == r.safe_count
00041 && checkmate_count == r.checkmate_count;
00042 }
00043 };
00044 struct ThreatmateIfMorePieces
00045 {
00046 vector<Ptype> hand_ptype;
00047 vector<Piece> board_ptype;
00048 bool operator==(const ThreatmateIfMorePieces& r) const
00049 {
00050 return hand_ptype == r.hand_ptype
00051 && board_ptype == r.board_ptype;
00052 }
00053 };
00054 struct Vision
00055 {
00056 vector<Move> pv;
00057 int eval, cur_eval;
00058 };
00059
00060 Trivalent checkmate, checkmate_win, threatmate, escape_from_check;
00061 Move checkmate_move, threatmate_move;
00062 double threatmate_probability;
00063 size_t threatmate_node_count;
00064 CheckmateForCapture checkmate_for_capture;
00065 CheckmateForEscape checkmate_for_escape;
00066 ThreatmateIfMorePieces threatmate_if_more_pieces;
00067 Vision vision;
00068
00069 AnalysesResult()
00070 : checkmate(Unknown), checkmate_win(Unknown), threatmate(Unknown),
00071 escape_from_check(Unknown),
00072 threatmate_probability(0), threatmate_node_count(0)
00073 {
00074 }
00075 };
00076 bool operator==(const AnalysesResult& l, const AnalysesResult& r);
00077 std::ostream& operator<<(std::ostream&, Trivalent);
00078 std::ostream& operator<<(std::ostream&, const AnalysesResult&);
00079 }
00080 }
00081
00082 #endif
00083
00084
00085
00086