示例#1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="nnEvaluator"></param>
        /// <param name="searchParams"></param>
        /// <param name="childSelectParams"></param>
        /// <param name="gameLimitManager"></param>
        /// <param name="paramsSearchExecutionModifier"></param>
        public GameEngineCeresInProcess(string id, NNEvaluatorDef evaluatorDef,
                                        ParamsSearch searchParams          = null,
                                        ParamsSelect childSelectParams     = null,
                                        IManagerGameLimit gameLimitManager = null,
                                        ParamsSearchExecutionModifier paramsSearchExecutionModifier = null) : base(id)
        {
            if (evaluatorDef == null)
            {
                throw new ArgumentNullException(nameof(evaluatorDef));
            }

            // Use default settings for search and select params if not specified.
            if (searchParams == null)
            {
                searchParams = new ParamsSearch();
            }
            if (childSelectParams == null)
            {
                childSelectParams = new ParamsSelect();
            }

            // Use default limit manager if not specified.
            if (gameLimitManager == null)
            {
                gameLimitManager = new ManagerGameLimitCeres();
            }

            ParamsSearchExecutionModifier = paramsSearchExecutionModifier;
            EvaluatorDef      = evaluatorDef;
            SearchParams      = searchParams;
            GameLimitManager  = gameLimitManager;
            ChildSelectParams = childSelectParams;
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="evaluatorDef"></param>
        /// <param name="searchParams"></param>
        /// <param name="childSelectParams"></param>
        /// <param name="gameLimitManager"></param>
        /// <param name="paramsSearchExecutionModifier"></param>
        /// <param name="logFileName"></param>
        public GameEngineCeresInProcess(string id, NNEvaluatorDef evaluatorDef,
                                        ParamsSearch searchParams          = null,
                                        ParamsSelect childSelectParams     = null,
                                        IManagerGameLimit gameLimitManager = null,
                                        ParamsSearchExecutionModifier paramsSearchExecutionModifier = null,
                                        string logFileName = null) : base(id)
        {
            if (evaluatorDef == null)
            {
                throw new ArgumentNullException(nameof(evaluatorDef));
            }

            // Use default settings for search and select params if not specified.
            if (searchParams == null)
            {
                searchParams = new ParamsSearch();
            }
            if (childSelectParams == null)
            {
                childSelectParams = new ParamsSelect();
            }

            // Use default limit manager if not specified.
            if (gameLimitManager == null)
            {
                gameLimitManager = new ManagerGameLimitCeres();
            }

            ParamsSearchExecutionModifier = paramsSearchExecutionModifier;
            EvaluatorDef      = evaluatorDef;
            SearchParams      = searchParams;
            GameLimitManager  = gameLimitManager;
            ChildSelectParams = childSelectParams;
            SearchLogFileName = logFileName;
            VerboseMoveStats  = CeresUserSettingsManager.Settings.VerboseMoveStats;

            if (!string.IsNullOrEmpty(CeresUserSettingsManager.Settings.SearchLogFile))
            {
                SearchLogFileName = CeresUserSettingsManager.Settings.SearchLogFile;
            }
        }