Ejemplo n.º 1
0
        public SearchConfig(string configInput)
        {
            var parts = configInput.Split(',');

            MoveTimeout = TimeSpan.FromSeconds(int.Parse(parts[0]));

            // defaults
            ReportStatistics    = false;
            GameMode            = GameMode.Beginning;
            _beginningHeuristic = new NumberOfMovesHeuristic();
            _middleHeuristic    = new OpenAreaHeuristic();
            _endHeuristic       = new LongestPathHeuristic();

            // timeout dependent config
            if (MoveTimeout.TotalSeconds > 45)
            {
                DepthLimit = 8;
                PercentTimeLeftToIncrementDepthLimit = 0.85;
            }
            else
            {
                DepthLimit = 7;
                PercentTimeLeftToIncrementDepthLimit = 0.90;
            }

            // allow depth limit to be entered manually in case 7 or 8 too deep for TA
            int depthLimitFromInput;

            if (parts.Length > 1 && int.TryParse(parts[1], out depthLimitFromInput))
            {
                DepthLimit = depthLimitFromInput;
            }
        }
Ejemplo n.º 2
0
        public SearchConfig(string configInput)
        {
            var parts = configInput.Split(',');
            MoveTimeout = TimeSpan.FromSeconds(int.Parse(parts[0]));

            // defaults
            ReportStatistics = false;
            GameMode = GameMode.Beginning;
            _beginningHeuristic = new NumberOfMovesHeuristic();
            _middleHeuristic = new OpenAreaHeuristic();
            _endHeuristic = new LongestPathHeuristic();

            // timeout dependent config
            if (MoveTimeout.TotalSeconds > 45)
            {
                DepthLimit = 8;
                PercentTimeLeftToIncrementDepthLimit = 0.85;
            }
            else
            {
                DepthLimit = 7;
                PercentTimeLeftToIncrementDepthLimit = 0.90;
            }

            // allow depth limit to be entered manually in case 7 or 8 too deep for TA
            int depthLimitFromInput;
            if (parts.Length > 1 && int.TryParse(parts[1], out depthLimitFromInput))
            {
                DepthLimit = depthLimitFromInput;
            }
        }
Ejemplo n.º 3
0
 // constructors
 public SearchConfig(SearchConfig toCopy)
 {
     DepthLimit = toCopy.DepthLimit;
     PercentTimeLeftToIncrementDepthLimit = toCopy.PercentTimeLeftToIncrementDepthLimit;
     ReportStatistics    = toCopy.ReportStatistics;
     MoveTimeout         = toCopy.MoveTimeout;
     GameMode            = toCopy.GameMode;
     _beginningHeuristic = toCopy._beginningHeuristic;
     _middleHeuristic    = toCopy._middleHeuristic;
     _endHeuristic       = toCopy._endHeuristic;
 }
Ejemplo n.º 4
0
 // constructors
 public SearchConfig(SearchConfig toCopy)
 {
     DepthLimit = toCopy.DepthLimit;
     PercentTimeLeftToIncrementDepthLimit = toCopy.PercentTimeLeftToIncrementDepthLimit;
     ReportStatistics = toCopy.ReportStatistics;
     MoveTimeout = toCopy.MoveTimeout;
     GameMode = toCopy.GameMode;
     _beginningHeuristic = toCopy._beginningHeuristic;
     _middleHeuristic = toCopy._middleHeuristic;
     _endHeuristic = toCopy._endHeuristic;
 }