All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
htmlPerformanceLog.cc
Go to the documentation of this file.
1 /* htmlPerformanceLog.cc
2  */
4 #include "osl/record/csa.h"
5 
7 HtmlPerformanceLog(const char *filename, const char *title)
8  : os(filename)
9 {
10  os << "<html><head><title>" << title << "</title></head>\n<body>\n";
11  os << "<table border=1>\n";
12  os << "<tr><td></td><td>search result</td><td>correct move</td>"
13  << "<td>#nodes</td><td>seconds</td><td>depth</td></tr>\n";
14 }
15 
17 {
18  os << "</table>\n";
19  os << "</body>\n";
20 }
21 
23 record(const char *name, Move correctMove, Move result,
24  unsigned int nodes, unsigned int qnodes, double seconds, int depth)
25 {
26  if (correctMove == result)
27  os << "<tr bgcolor=\"green\">";
28  else
29  os << "<tr>";
30  os << "<td>" << name << "</td><td>";
31  if (correctMove == result)
32  os << "OK";
33  else
34  {
35  csaShow(os, result);
36  }
37  os << "</td><td>";
38  csaShow(os, correctMove);
39  os << "</td>\n\t<td id=\"nodes\" align=right>" << nodes + qnodes << "</td>\n"
40  << "\t<td id=\"seconds\" align=right>" << seconds << "</td>\n"
41  << "\t<td id=\"depth\" align=right>" << depth << "</td></tr>\n"
42  << std::flush;
43 }
44 
45 /* ------------------------------------------------------------------------- */
46 // ;;; Local Variables:
47 // ;;; mode:c++
48 // ;;; c-basic-offset:2
49 // ;;; End: