Skip to content

Commit

Permalink
Also have analysis log to dir
Browse files Browse the repository at this point in the history
  • Loading branch information
lightvector committed May 10, 2020
1 parent 107f04f commit ca6cb4e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
13 changes: 12 additions & 1 deletion cpp/command/analysis.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "../core/global.h"
#include "../core/config_parser.h"
#include "../core/timer.h"
#include "../core/datetime.h"
#include "../core/makedir.h"
#include "../search/asyncbot.h"
#include "../program/setup.h"
#include "../program/playutils.h"
Expand Down Expand Up @@ -67,7 +69,16 @@ int MainCmds::analysis(int argc, const char* const* argv) {
}

Logger logger;
logger.addFile(cfg.getString("logFile"));
if(cfg.contains("logFile") && cfg.contains("logDir"))
throw StringError("Cannot specify both logFile and logDir in config");
else if(cfg.contains("logFile"))
logger.addFile(cfg.getString("logFile"));
else {
MakeDir::make(cfg.getString("logDir"));
Rand rand;
logger.addFile(cfg.getString("logDir") + "/" + DateTime::getCompactDateTimeString() + "-" + Global::uint32ToHexString(rand.nextUInt()) + ".log");
}

logger.setLogToStderr(true);

logger.write("Analysis Engine starting...");
Expand Down
11 changes: 10 additions & 1 deletion cpp/configs/analysis_example.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@
# Logs------------------------------------------------------------------------------------

# Where to output log?
logFile = gtp.log
logDir = analysis_logs # Each run of KataGo will log to a separate file in this dir
# logFile = analysis.log # Use this instead of logDir to just specify a single file directly

# Analysis------------------------------------------------------------------------------------

# Controls the number of moves after the first move in a variation.
# analysisPVLen = 15

# Report winrates for analysis as (BLACK|WHITE|SIDETOMOVE).
reportAnalysisWinratesAs = BLACK

# Uncomment and and set to a positive value to make KataGo explore the top move(s) less deeply and accurately,
# but explore and give evaluations to a greater variety of moves, for analysis (does NOT affect play).
# A value like 0.03 or 0.06 will give various mildly but still noticeably wider searches.
# An extreme value like 1 will distribute many playouts across every move on the board, even very bad moves.
# wideRootNoise = 0.0

# Bot behavior---------------------------------------------------------------------------------------

# Handicap -------------
Expand Down

0 comments on commit ca6cb4e

Please sign in to comment.