public void HashSetBenchmark()
        {
            var hs     = new HashGrid(new HashSet <Coordinate>(_state), Dimensions);
            var buffer = new Dictionary <Coordinate, bool>(Dimensions);
            var gol    = new GameOfLife();

            gol.Run(hs, buffer, Iterations);
        }
        public void Step2_OfGlider_IsCorrect()
        {
            var state = InitialStates.Glider;
            var grid  = new HashGrid(new HashSet <Coordinate>(state), 80);

            var res = new StepResult();

            new GameOfLife().Step(res, grid, new Dictionary <Coordinate, bool>());

            var alive = res.State.Values.Count(v => v);

            Coordinate[] expected =
            {
                (0, 1), (2, 1),
                (1, 2), (2, 2),
                (1, 3)
            };
Exemple #3
0
 void Start()
 {
     _seed  = new Vector3(Random.Range(-SEED, SEED), Random.Range(-SEED, SEED), Random.Range(-SEED, SEED));
     _world = HashGrid.World;
 }