Package application.model.patterns
Class LinearGrowth
java.lang.Object
application.model.simulation.Grid
application.model.simulation.Simulator
application.model.patterns.Pattern
application.model.patterns.LinearGrowth
public class LinearGrowth extends Pattern
Represents a linear growth
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LinearGrowth(Rule rule, Grid pattern, int popPeriod)
Constructs a linear growth -
Method Summary
Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>
additionalInfo()
static int
deepPeriod(int[] sequence, int maxPeriod, int degree)
Gets the period of an interleaving of degree-d polynomials.void
setPhases(Grid[] grids)
java.lang.String
toString()
Methods inherited from class application.model.patterns.Pattern
compareString, getMaxRule, getMinRule, getName, setMaxRule, setMinRule
Methods inherited from class application.model.simulation.Simulator
clearCells, getCellsChanged, getGeneration, getRule, identify, identify, identify, setCell, setCell, setGeneration, setRule, step, step, toRLE
Methods inherited from class application.model.simulation.Grid
addBlock, bfs, clearCells, convertCell, deepCopy, equals, fromApgcode, fromRLE, getBackground, getBlock, getBlockCoordinate, getBlockCoordinates, getBlocks, getBounds, getCell, getCell, getCells, getPopulation, hashCode, hashCode, hashCode, hasNext, insertCells, iterateCells, iterateCellsInBlock, iterator, next, reflectCellsX, reflectCellsY, removeBlock, rotateCCW, rotateCW, setBackground, shallowCopy, size, slowEquals, toArray, toRLE, updateBounds
-
Constructor Details
-
LinearGrowth
Constructs a linear growth- Parameters:
rule
- The rule that the pattern works inpattern
- The linear growthpopPeriod
- The population period of the linear growth
-
-
Method Details
-
toString
public java.lang.String toString() -
additionalInfo
public java.util.Map<java.lang.String,java.lang.String> additionalInfo()- Specified by:
additionalInfo
in classPattern
-
setPhases
-
deepPeriod
public static int deepPeriod(int[] sequence, int maxPeriod, int degree)Gets the period of an interleaving of degree-d polynomials. Totally not stolen from apgsearch 1.x.- Parameters:
sequence
- The sequence of values of the polynomialmaxPeriod
- The max period of the polynomialdegree
- The degree of the polynomial- Returns:
- Returns the period of the polynomial (-1 for no period)
-