mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 11:39:15 +00:00
Merged uci parse logic.
This commit is contained in:
parent
f58d616198
commit
24576d77ab
2 changed files with 35 additions and 1 deletions
|
@ -989,6 +989,6 @@ void update_weights(uint64_t epoch, const std::array<bool, 4> & freeze) {}
|
|||
void init_grad(double eta1, uint64_t eta_epoch, double eta2, uint64_t eta2_epoch, double eta3) {}
|
||||
void add_grad(Position& pos, Color rootColor, double delt_grad, const std::array<bool, 4> & freeze) {}
|
||||
void save_eval(std::string suffix) {}
|
||||
double get_eta() {}
|
||||
double get_eta() { return 0.0; }
|
||||
}
|
||||
#endif // defined(EVAL_NNUE)
|
||||
|
|
34
src/uci.cpp
34
src/uci.cpp
|
@ -40,6 +40,30 @@ extern vector<string> setup_bench(const Position&, istream&);
|
|||
// FEN string of the initial position, normal chess
|
||||
const char* StartFEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
|
||||
|
||||
// 棋譜を自動生成するコマンド
|
||||
#if defined (EVAL_LEARN)
|
||||
namespace Learner
|
||||
{
|
||||
// 教師局面の自動生成
|
||||
void gen_sfen(Position& pos, istringstream& is);
|
||||
|
||||
// 生成した棋譜からの学習
|
||||
void learn(Position& pos, istringstream& is);
|
||||
|
||||
#if defined(GENSFEN2019)
|
||||
// 開発中の教師局面の自動生成コマンド
|
||||
void gen_sfen2019(Position& pos, istringstream& is);
|
||||
#endif
|
||||
|
||||
// 読み筋と評価値のペア。Learner::search(),Learner::qsearch()が返す。
|
||||
typedef std::pair<Value, std::vector<Move> > ValueAndPV;
|
||||
|
||||
ValueAndPV qsearch(Position& pos);
|
||||
ValueAndPV search(Position& pos, int depth_, size_t multiPV = 1, uint64_t nodesLimit = 0);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
// position() is called when engine receives the "position" UCI command.
|
||||
// The function sets up the position described in the given FEN string ("fen")
|
||||
|
@ -301,6 +325,16 @@ void UCI::loop(int argc, char* argv[]) {
|
|||
else if (token == "bench") bench(pos, is, states);
|
||||
else if (token == "d") sync_cout << pos << sync_endl;
|
||||
else if (token == "eval") sync_cout << Eval::trace(pos) << sync_endl;
|
||||
#if defined (EVAL_LEARN)
|
||||
else if (token == "gensfen") Learner::gen_sfen(pos, is);
|
||||
else if (token == "learn") Learner::learn(pos, is);
|
||||
|
||||
#if defined (GENSFEN2019)
|
||||
// 開発中の教師局面生成コマンド
|
||||
else if (token == "gensfen2019") Learner::gen_sfen2019(pos, is);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
else
|
||||
sync_cout << "Unknown command: " << cmd << sync_endl;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue