Go to the documentation of this file.00001
00002
00003 #ifndef OSL_USIREPORTER_H
00004 #define OSL_USIREPORTER_H
00005 #include "osl/search/searchMonitor.h"
00006 #include "osl/misc/milliSeconds.h"
00007 #include <boost/asio/ip/udp.hpp>
00008 #include <iosfwd>
00009
00010 namespace osl
00011 {
00012 namespace search
00013 {
00014 struct UsiReporter
00015 {
00016 static void newDepth(std::ostream& os, int depth);
00017 static void showPV(std::ostream& os, int depth, size_t node_count, double elapsed, int value, Move cur, const Move *first, const Move *last, bool ignore_silent=false);
00018 static void showPVExtended(std::ostream& os, int depth, size_t node_count, double elapsed, int value, Move cur, const Move *first, const Move *last,
00019 const bool *threatmate_first, const bool *threatmate_last);
00020 static void rootMove(std::ostream& os, Move cur, bool allow_frequent_display=false);
00021 static void timeInfo(std::ostream& os, size_t node_count, double elapsed);
00022 static void hashInfo(std::ostream& os, double ratio);
00023 };
00024
00025 class UsiMonitor : public SearchMonitor
00026 {
00027 Move last_root_move;
00028 std::string deferred;
00029 double silent_period;
00030 bool extended;
00031 MilliSeconds depth0;
00032 std::ostream& os;
00033 boost::asio::ip::udp::socket *udp_socket;
00034 boost::asio::ip::udp::endpoint *udp_endpoint;
00035 public:
00036 UsiMonitor(bool extended, std::ostream& os, double silent=0.5);
00037 ~UsiMonitor();
00038 void setUdpLogging(boost::asio::ip::udp::socket *,
00039 boost::asio::ip::udp::endpoint *);
00040 void newDepth(int depth);
00041 void showPV(int depth, size_t node_count, double elapsed, int value, Move cur, const Move *first, const Move *last,
00042 const bool *threatmate_first, const bool *threatmate_last);
00043 void rootMove(Move cur);
00044 void rootFirstMove(Move cur);
00045 void timeInfo(size_t node_count, double elapsed);
00046 void hashInfo(double ratio);
00047 void rootForcedMove(Move the_move);
00048 void rootLossByCheckmate();
00049 private:
00050 void showDeferred();
00051 };
00052 }
00053 using search::UsiMonitor;
00054 }
00055
00056
00057 #endif
00058
00059
00060
00061