public static int Cell__Centrality( this PM_Maze maze, Vec2i cellPosition ) { return(maze.Cell__Centrality(cellPosition.x, cellPosition.y)); }
public static double Average_Cell_Centrality(this PM_Maze maze) { double sum = 0.0; for (int x = 0; x < maze.Q_Width(); x++) { for (int y = 0; y < maze.Q_Height(); y++) { sum += (double)maze.Cell__Centrality(x, y); } } int numCells = maze.NumCells__All(); return(sum / (double)numCells); }
public static HashSet <Vec2i> CellsPositions_OfCentrality_Set(this PM_Maze maze, int requestedCentrality) { int width = maze.Q_Width(); int height = maze.Q_Height(); HashSet <Vec2i> cells_ofCentrality_set = new HashSet <Vec2i>(); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { if (maze.Cell__Centrality(x, y) == requestedCentrality) { cells_ofCentrality_set.Add(new Vec2i(x, y)); } } } return(cells_ofCentrality_set); }
public static int NumCells__OfCentrality( this PM_Maze maze, int requestedCentrality ) { int width = maze.Q_Width(); int height = maze.Q_Height(); int num = 0; for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { if (maze.Cell__Centrality(x, y) == requestedCentrality) { num++; } } } return(num); }