Class Symmetry

java.lang.Object
application.model.rules.ruleloader.ruletable.Symmetry

public class Symmetry
extends java.lang.Object
Represents symmetries as disjoint cycles like lifelib. See https://groupprops.subwiki.org/wiki/Cycle_decomposition_for_permutations.
  • Constructor Summary

    Constructors 
    Constructor Description
    Symmetry​(int[][][] disjointCycles)
    Constructs a new symmetry with the provided disjoint cycles
    Symmetry​(java.lang.String symmetry)
    Constructs a new symmetry with an inputted string.
  • Method Summary

    Modifier and Type Method Description
    <T> java.util.ArrayList<java.util.ArrayList<T>> applySymmetry​(java.util.ArrayList<T> neighbours)
    Applies the symmetry on the provided array list

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Symmetry

      public Symmetry​(java.lang.String symmetry)
      Constructs a new symmetry with an inputted string. For example, [[(1, 3, 5, 7), (2, 4, 6, 8)], [(2, 8), (3, 7), (4, 6)]]
      Parameters:
      symmetry - The symmetry string that represents the symmetry in the form of disjoint cycles.
    • Symmetry

      public Symmetry​(int[][][] disjointCycles)
      Constructs a new symmetry with the provided disjoint cycles
      Parameters:
      disjointCycles - The disjoint cycles that represent the symmetry
  • Method Details

    • applySymmetry

      public <T> java.util.ArrayList<java.util.ArrayList<T>> applySymmetry​(java.util.ArrayList<T> neighbours)
      Applies the symmetry on the provided array list
      Type Parameters:
      T - The type of the array list
      Parameters:
      neighbours - The neighbours of the cell that the symmetry should be applied on
      Returns:
      Returns an array list of array lists represents the permutations