swarm-0.7.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellNone
LanguageHaskell2010

Swarm.Game.Scenario.Topography.Structure.Recognition.Symmetry

Description

Symmetry analysis for structure recognizer.

Synopsis

Documentation

checkSymmetry :: Eq a => ExtractedArea b a -> Either RedundantOrientations (SymmetryAnnotatedGrid (ExtractedArea b a)) Source #

Warns if any recognition orientations are redundant by rotational symmetry. We can accomplish this by testing only two rotations:

  1. Rotate 90 degrees. If identical to the original orientation, then has 4-fold symmetry and we don't need to check any other orientations. Warn if more than one recognition orientation was supplied.
  2. Rotate 180 degrees. At best, we may now have 2-fold symmetry. Warn if two opposite orientations were supplied.