File: fixedDepthSearchPerf.cc

package info (click to toggle)
libosl 0.8.0-4.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,328 kB
  • sloc: cpp: 114,345; ruby: 1,290; ansic: 915; makefile: 431; perl: 309; sh: 35
file content (40 lines) | stat: -rw-r--r-- 1,078 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "osl/csa.h"
#include "osl/checkmate/fixedDepthSearcher.tcc"
#include "osl/state/numEffectState.h"
#include "osl/misc/perfmon.h"
#include <time.h>
#include <sys/time.h>
#include <iostream>
using namespace osl;
using namespace osl::checkmate;

int main()
{
  SimpleState state=CsaString(
"P1-KY *  *  * -KY * -FU-KE * \n"
"P2 *  *  *  * -OU *  *  *  * \n"
"P3 *  *  * -FU-FU *  *  * -KY\n"
"P4-FU *  * -GI *  *  *  *  * \n"
"P5 *  *  *  *  *  *  *  *  * \n"
"P6+FU *  * +RY * +HI+FU *  * \n"
"P7 * +FU * +FU+FU+FU *  *  * \n"
"P8 *  * +OU * -TO *  *  *  * \n"
"P9+KY *  *  *  *  *  * +KE * \n"
"P+00KI00GI00GI00GI00KE00KE00FU00FU00FU00KI\n"
"P-00KA00KA00KI00FU00FU00FU00FU00KI\n"
"+\n").getInitialState();
  NumEffectState eState(state);
  ProofDisproof pdp;
  osl::misc::PerfMon perfmon;
  FixedDepthSearcher searcher(eState);
  perfmon.restart();
  searcher.setCount(0);
  for(int i=0;i<1000;i++)
    {
      Move dummy;
    pdp=searcher.hasCheckmateMove<BLACK>(1,dummy);
  }
  perfmon.stop("total", searcher.getCount());
  std::cerr << pdp << std::endl;
  return 0;
}