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

            clone.Logger = this.Logger;
            return(clone);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor from a given tournament defintion.
        /// </summary>
        /// <param name="def"></param>
        public TournamentGameRunner(TournamentDef def)
        {
            Def = def;

            // Create and warmup both engines (in parallel)
            Parallel.Invoke(() => { Engine1 = def.Player1Def.EngineDef.CreateEngine(); Engine1.Warmup(); },
                            () => { Engine2 = def.Player2Def.EngineDef.CreateEngine(); Engine2.Warmup(); });

            Engine1.OpponentEngine = Engine2;
            Engine2.OpponentEngine = Engine1;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="def"></param>
        /// <param name="numParallel"></param>
        /// <param name="separateGPUs"></param>
        public TournamentManager(TournamentDef def, int numParallel = 1)
        {
            Def           = def;
            NumConcurrent = numParallel;

            // Turn off showing game moves if running parallel,
            // since the moves of various games would be intermixed.
            if (numParallel > 1)
            {
                def.ShowGameMoves = false;
            }

#if NOT
            if (def.EvaluatorDef2.DeviceCombo == NNEvaluators.Defs.NNEvaluatorDeviceComboType.Pooled)
            {
                // If already pooled then having separate GPUs does not make sense
                SeparateGPUs = false;
            }
#endif
        }
Exemplo n.º 4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="def"></param>
 /// <param name="parentTestResults"></param>
 public TournamentGameThread(TournamentDef def, TournamentResultStats parentTestResults)
 {
     Def         = def;
     ParentStats = parentTestResults;
 }