Ejemplo n.º 1
0
        public TournamentDef Clone()
        {
            TournamentDef clone = ObjUtils.DeepClone <TournamentDef>(this);

            clone.Logger = this.Logger;
            return(clone);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public GameEngineDefCeres(string id, NNEvaluatorDef evaluatorDef, ParamsSearch searchParams = null,
                           ParamsSearchExecutionModifier paramsSearchExecutionPostprocessor  = null,
                           ParamsSelect selectParams = null, IManagerGameLimit overrideTimeManager = null)
     : base(id)
 {
     // Make a defensive clone of the EvaluatorDef so it will definitely not be shared.
     EvaluatorDef = ObjUtils.DeepClone(evaluatorDef);
     SearchParams = searchParams ?? new ParamsSearch();
     ParamsSearchExecutionPostprocessor = paramsSearchExecutionPostprocessor;
     SelectParams        = selectParams ?? new ParamsSelect();
     OverrideTimeManager = overrideTimeManager;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="evaluatorDef"></param>
        /// <param name="forceDisableSmartPruning"></param>
        /// <param name="searchParamsEmulate"></param>
        /// <param name="selectParamsEmulate"></param>
        /// <param name="overrideEXE"></param>
        /// <param name="extraCommandLineArgs"></param>
        public GameEngineDefLC0(string id,
                                NNEvaluatorDef evaluatorDef,
                                bool forceDisableSmartPruning,
                                ParamsSearch searchParamsEmulate = null,
                                ParamsSelect selectParamsEmulate = null,
                                string overrideEXE          = null,
                                string extraCommandLineArgs = null)
            : base(id)
        {
            if ((SearchParamsEmulate == null) != (SelectParamsEmulate == null))
            {
                throw new ArgumentException("SearchParamsEmulate and SelectParamsEmulate must be both provided or not");
            }

            // Verify compatability of evaluator for LC0
            if (evaluatorDef == null)
            {
                throw new ArgumentNullException(nameof(evaluatorDef));
            }
            if (evaluatorDef.Nets.Length != 1)
            {
                throw new Exception("Exactly one network must be specified for use with LC0.");
            }
            if (evaluatorDef.Nets[0].Net.Type != NNEvaluatorType.LC0Library)
            {
                throw new Exception("Network Type must be LC0Library");
            }
            if (evaluatorDef.NetCombo != NNEvaluatorNetComboType.Single)
            {
                throw new Exception("Network Type must be Single");
            }

            ID = id;

            // Make a defensive clone of the EvaluatorDef so it will definitely not be shared.
            EvaluatorDef = ObjUtils.DeepClone(evaluatorDef);

            ForceDisableSmartPruning = forceDisableSmartPruning;

            SearchParamsEmulate  = searchParamsEmulate;
            SelectParamsEmulate  = selectParamsEmulate;
            OverrideEXE          = overrideEXE;
            ExtraCommandLineArgs = extraCommandLineArgs;
        }