static async Task Main(string[] args) { // var consoleGrid = new ConsoleGrid(40); // var initialState = InitialStates.Glider; // consoleGrid.Center(initialState); // await GameOfLife.RunAsync(200, consoleGrid, new Dictionary<Coordinate, bool>()); const int dims = 40; var state = GetInitialState(dims, 10); const int iters = 1_000; //var cg = new ConsoleGrid(dims, state); ////var hg = new HashGrid(new HashSet<Coordinate>(state), dims); //var gol = new GameOfLife(); //await gol.RunAsync(200, cg, new Dictionary<Coordinate, bool>(), iters); var pgol = new ParallelGameOfLife(); pgol.Run <ParallelHashGrid, ConsoleView>(new ParallelHashGrid(state), new GameOfLifeOptions { /*DelayMillis = 200,*/ MaxIterations = iters, Dimensions = dims }); //Console.WriteLine("starting parallel"); //RunTest(state, dims, iters); //Console.WriteLine("done"); //RunEventBased(); }
public void AggressiveParallelRemoveStackAllocForeach() { var grid = new ParallelHashGrid_NoStackAlloc(_state); var gol = new ParallelGameOfLife(); gol.Run <ParallelHashGrid_NoStackAlloc, NullView>(grid, new GameOfLifeOptions { MaxIterations = Iterations }); }
public void ParallelHashSet() { var grid = new ParallelHashGrid(_state); var gol = new ParallelGameOfLife(); gol.Run <ParallelHashGrid, NullView>(grid, new GameOfLifeOptions { MaxIterations = Iterations }); }