Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
minimax_evaluator_factory.hpp
Go to the documentation of this file.
1#pragma once
2
7#include <memory>
10#include <string>
11
12namespace moveselection {
13template <typename KeyType, size_t NumConfKeys>
19 std::shared_ptr<G> game_board_;
21 uint32_t zkeys_seed_;
22 const std::string &json_file_;
23
24public:
26 std::shared_ptr<G> game_board,
27 DepthType search_depth,
28 uint32_t zkeys_seed = std::random_device{}(),
29 const std::string &json_file = piecepoints::kICGABPOPath
30 )
32 , game_board_{game_board}
33 , search_depth_{search_depth}
34 , zkeys_seed_{zkeys_seed}
35 , json_file_{json_file} {}
36
37 using ZobristCoordinatorType = typename boardstate::
38 ZobristCoordinatorFactory<KeyType, NumConfKeys, G>::ZobristCoordinatorType;
39
42
43 std::unique_ptr<MoveEvaluatorBase> Create(gameboard::PieceColor evaluating_player
44 ) override {
48 );
49
50 auto game_position_points = P::Create();
51 return std::make_unique<MoveEvaluatorType>(
52 evaluating_player,
55 game_position_points,
56 zobrist_coordinator
57 );
58 }
59};
60} // namespace moveselection
std::shared_ptr< ZobristCoordinatorType > CreateRegisteredCoordinator(std::shared_ptr< G > game_board, uint32_t zobrist_component_seed=std::random_device{}())
Must comply with SpaceInfoProviderConcept; stores piece positions, and exposes methods for calculatin...
boardstate::ZobristCoordinatorFactory< KeyType, NumConfKeys, G > Z
MinimaxMoveEvaluatorFactory(std::shared_ptr< G > game_board, DepthType search_depth, uint32_t zkeys_seed=std::random_device{}(), const std::string &json_file=piecepoints::kICGABPOPath)
typename boardstate::ZobristCoordinatorFactory< KeyType, NumConfKeys, G >::ZobristCoordinatorType ZobristCoordinatorType
std::unique_ptr< MoveEvaluatorBase > Create(gameboard::PieceColor evaluating_player) override
Complies with MoveEvaluatorConcept, and selects move::Move using Minimax algorithm; uses SpaceInfoPro...
uint16_t DepthType
Selecting a move to execute.
const string kICGABPOPath
Holds a piecepoints::GamePointsArray_t of points values, and exposes a method for accessing element c...
static std::shared_ptr< PiecePositionPointsForConcepts > Create(std::string json_file=piecepoints::kICGABPOPath)