facade.cc Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
annotate/facade.cc
Go to the documentation of this file.
1 #include "osl/annotate/facade.h"
2 #include "osl/annotate/analyzer.h"
3 #include "osl/progress/ml/newProgress.h"
4 #include "osl/eval/ml/openMidEndingEval.h"
5 #include <boost/ptr_container/ptr_vector.hpp>
6 #include <boost/foreach.hpp>
7
8 void osl::annotate::
9 analyze(const NumEffectState& src, const vector<Move>& moves,
10 int last_move,
11 AnalysesResult& result)
12 {
13 static boost::ptr_vector<Analyzer> analyzers;
14 static bool initialized = false;
15 if (! initialized)
16 {
17 analyzers.push_back(new RepetitionAnalyzer);
18 analyzers.push_back(new CheckmateAnalyzer);
19 analyzers.push_back(new CheckmateWin);
20 analyzers.push_back(new EscapeFromCheck);
21 analyzers.push_back(new CheckmateForCapture);
22 analyzers.push_back(new ThreatmateAnalyzer);
23 analyzers.push_back(new CheckmateForEscape);
24 analyzers.push_back(new ThreatmateIfMorePieces);
25 analyzers.push_back(new Vision3);
26 progress::ml::NewProgress::setUp();
27 eval::ml::OpenMidEndingEval::setUp();
28 initialized = true;
29 }
30 result = AnalysesResult();
31 BOOST_FOREACH(Analyzer& a, analyzers)
32 {
33 a.match(result, src, moves, last_move);
34 if (result.checkmate == True)
35 break;
36 }
37 }
38
39 // ;;; Local Variables:
40 // ;;; mode:c++
41 // ;;; c-basic-offset:2
42 // ;;; End: