private static BaseGridFactory getDefaultGridFactory(int dim) {
switch (dim) {
case 1:
return new ArrayGrid1DFactory();
case 2:
return new ArrayGrid2DFactory();
default:
throw new UnsupportedOperationException(
"Only 1d and 2d CA grids supported.");
}
}