예제 #1
0
        public void GetMoveParallel_Simulation_()
        {
            var map   = MapTest.Map18;
            var state = State.Create(map);

            var simParallel = new MonteCarloSimulation(17, true);
            var act         = simParallel.GetMove(map, PlayerType.Hero1, state, SimulationTime, 300);

            Console.WriteLine("{0:#,##0.00}k/s (Parallel)", simParallel.Simulations / SimulationTime.TotalMilliseconds);
        }
예제 #2
0
        public void GetMoveParallel_Simulation_()
        {
            var state = State.Create(MapTest.Map16);

            var simParallel = new MonteCarloSimulation(17, true);
            var act         = simParallel.GetMove(MapTest.Map16, state, SimulationTime);

            Console.WriteLine("{0:#,##0.00}k/s (Parallel)", simParallel.Simulations / SimulationTime.TotalMilliseconds);

            Assert.AreEqual(MoveDirection.E, act);
        }
예제 #3
0
        public void GetMove_Performance_()
        {
            var state = State.Create(MapTest.Map16);

            var simSingle = new MonteCarloSimulation(17, false);

            var time = TimeSpan.FromSeconds(2);

            var moveSingle = simSingle.GetMove(MapTest.Map16, state, time);

            Console.WriteLine("{0:#,##0.00}k/s (Single)", simSingle.Simulations / time.TotalMilliseconds);
        }