mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +08:00
Merged uci parse logic.
This commit is contained in:
@@ -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";
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>}<7D><><EFBFBD>h
|
||||
#if defined (EVAL_LEARN)
|
||||
namespace Learner
|
||||
{
|
||||
// <20><><EFBFBD>t<EFBFBD>ǖʂ̎<CA82><CC8E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void gen_sfen(Position& pos, istringstream& is);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̊w<CC8A>K
|
||||
void learn(Position& pos, istringstream& is);
|
||||
|
||||
#if defined(GENSFEN2019)
|
||||
// <20>J<EFBFBD><4A><EFBFBD><EFBFBD><EFBFBD>̋<EFBFBD><CC8B>t<EFBFBD>ǖʂ̎<CA82><CC8E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>}<7D><><EFBFBD>h
|
||||
void gen_sfen2019(Position& pos, istringstream& is);
|
||||
#endif
|
||||
|
||||
// <20>ǂƕ]<5D><><EFBFBD>l<EFBFBD>̃y<CC83>A<EFBFBD>BLearner::search(),Learner::qsearch()<29><><EFBFBD>Ԃ<EFBFBD><D482>B
|
||||
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)
|
||||
// <20>J<EFBFBD><4A><EFBFBD><EFBFBD><EFBFBD>̋<EFBFBD><CC8B>t<EFBFBD>ǖʐ<C796><CA90><EFBFBD><EFBFBD>R<EFBFBD>}<7D><><EFBFBD>h
|
||||
else if (token == "gensfen2019") Learner::gen_sfen2019(pos, is);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
else
|
||||
sync_cout << "Unknown command: " << cmd << sync_endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user