Class PowerLawPattern

All Implemented Interfaces:
java.lang.Iterable<Block>, java.util.Iterator<Block>

public class PowerLawPattern
extends Pattern
Represents a pattern whose average population follows a power law. Essentially apgsearch's zz_REPLICATOR, zz_LINEAR, zz_EXPLOSIVE and zz_QUADRATIC.
  • Constructor Details

    • PowerLawPattern

      public PowerLawPattern​(Rule rule, Grid pattern, double power)
      Constructs a power law pattern with the specified growth rate
      Parameters:
      rule - The rule that the pattern works in
      pattern - The power law pattern
      power - The pattern's growth rate
  • Method Details

    • toString

      public java.lang.String toString()
      Specified by:
      toString in class Pattern
    • additionalInfo

      public java.util.Map<java.lang.String,​java.lang.String> additionalInfo()
      Specified by:
      additionalInfo in class Pattern
    • regress

      public static double regress​(java.util.ArrayList<org.javatuples.Pair<java.lang.Double,​java.lang.Double>> pointList)
      Finds the gradient of a list of points. Totally not stolen from apgsearch 1.x.
      Parameters:
      pointList - The list of points
      Returns:
      Returns the gradient of the list of points