Class SquareCrossClustersIntoGrids


public class SquareCrossClustersIntoGrids extends Object
Takes as input a set of unordered cross connected clusters and converts them into ordered grids with known numbers of rows and columns. The output will be valid "chessboard" pattern. When rows and columns are discussed in the code below it refers to both white and black squares in the chessboard. A row that starts with a white square is referred to as white and one which starts with a black square as black.
  • Field Details

    • invalid

      protected boolean invalid
  • Constructor Details

    • SquareCrossClustersIntoGrids

      public SquareCrossClustersIntoGrids()
  • Method Details

    • process

      public void process(List<List<SquareNode>> clusters)
      Converts all the found clusters into grids, if they are valid.
      clusters - List of clusters
    • checkPreconditions

      protected boolean checkPreconditions(List<SquareNode> cluster)
      Checks basic preconditions. 1) No node may be linked two more than once
    • processCluster

      protected void processCluster(List<SquareNode> cluster)
      Converts the cluster into a grid data structure. If its not a grid then nothing happens
    • getGrids

      public DogArray<SquareGrid> getGrids()