Exemple #1
0
 public PerftBench()
 {
     _pp = PerftPositionFactory.Create(Fen.StartPositionFen,
                                       new List <(int, ulong)>(6)
     {
         (1, 20),
         (2, 400),
         (3, 8902),
         (4, 197281),
         (5, 4865609),
         (6, 119060324)
     });
Exemple #2
0
        private async IAsyncEnumerable <IPerftPosition> ParseFen(FenOptions options)
        {
            const ulong zero = 0UL;

            var depths = options.Depths.Select(d => (d, zero)).ToList();

            var perftPositions = options.Fens.Select(f => PerftPositionFactory.Create(f, depths));

            foreach (var perftPosition in perftPositions)
            {
                yield return(perftPosition);
            }
        }
Exemple #3
0
#pragma warning disable 1998

        private static async IAsyncEnumerable <IPerftPosition> ParseFen(FenOptions options)
#pragma warning restore 1998
        {
            const ulong zero = 0UL;

            var depths = options.Depths.Select(d => (d, zero)).ToList();

            var perftPositions = options.Fens.Select(f => PerftPositionFactory.Create(Guid.NewGuid().ToString(), f, depths));

            foreach (var perftPosition in perftPositions)
            {
                yield return(perftPosition);
            }
        }
Exemple #4
0
        private async IAsyncEnumerable <IPerftPosition> ParseEpd(EpdOptions options)
        {
            _epdParser.Settings.Filename = options.Epds.First();
            var sw = Stopwatch.StartNew();

            var parsedCount = await _epdParser.ParseAsync().ConfigureAwait(false);

            sw.Stop();
            var elapsedMs = sw.ElapsedMilliseconds;

            _log.Information("Parsed {0} epd entries in {1} ms", parsedCount, elapsedMs);

            var perftPositions = _epdParser.Sets.Select(set => PerftPositionFactory.Create(set.Id, set.Epd, set.Perft));

            foreach (var perftPosition in perftPositions)
            {
                yield return(perftPosition);
            }
        }