Class SquareGeometry
Object
AbstractGeometry
AbstractLattice
SquareGeometry
- Direct Known Subclasses:
MooreGeometry, SecondNeighbourGeometry, VonNeumannGeometry
Square lattice with arbitrary neighbourhood sizes. Provides shared helpers
for square-based variants.
-
Field Summary
Fields inherited from class AbstractLattice
fixedBoundaryFields inherited from class AbstractGeometry
cli, connectivity, derivedId, EMPTY_LINKS, engine, features, geometryId, in, isInterspecies, isRegular, isRewired, isSingle, isUndirected, isValid, kin, kout, logger, name, network2D, network3D, out, pAddwire, pRewire, size, specs, type -
Constructor Summary
ConstructorsConstructorDescriptionSquareGeometry(EvoLudo engine) Create a square lattice geometry tied to the given engine. -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidadjustBoundaries(AbstractGeometry geometry, int range, int side, int fullside, int offset, boolean interspecies) Adjust arbitrary-range neighbourhoods along fixed boundaries.protected booleanHook for subclasses to implement geometry specific checks.voidinit()Generates square regular lattices with arbitrary neighbourhood sizes.static voidinitHierarchicalSquare(AbstractGeometry geometry, int popSize, int demeSize, int startIndex, boolean fixedBoundary) Initialize one hierarchical square deme using population and deme sizes.static voidinitSquare(AbstractGeometry geometry, int side, int fullside, int offset, boolean fixedBoundary) Initialize a square lattice with arbitrary (odd) neighbourhood sizes.static voidinitSquareSelf(AbstractGeometry geometry, int side, int fullside, int offset) Initialize a square lattice that only connects nodes to themselves (used when connectivity equals one).booleanParse geometry-specific CLI options.protected intCommon setup for square geometries.protected voidwarnIfConnectivityProvided(String numeric) Emit a warning if the user attempts to specify connectivity for a fixed stencil.Methods inherited from class AbstractLattice
clone, ensureSquareSize, equals, hashCode, isFixedBoundary, setFixedBoundary, stripBoundaryMethods inherited from class AbstractGeometry
addDirected, addEdgeAt, addLinkAt, addUndirected, alloc, check, clearLinksFrom, clearLinksTo, create, create, create, decodeGeometry, deriveCompetitionGeometry, displaySingle, encodeGeometry, enforceSize, getAddwire, getCLI, getConnectivity, getEncodeKey, getFeatures, getLabel, getName, getNetwork2D, getNetwork3D, getRewire, getSize, getSpecs, getType, isConsistent, isDerivedFrom, isGraphConnected, isInterspecies, isLattice, isNeighborOf, isRegular, isRewired, isSingle, isType, isUndirected, isUnique, markDerivedFrom, parse, removeEdgeAt, removeLinkAt, rewire, rewireDirected, rewireEdgeAt, rewireLinkAt, rewireUndirected, setAddwire, setConnectivity, setInterspecies, setName, setNetwork2D, setNetwork3D, setRewire, setSingle, setSize, setType, swapEdges, usage, warn
-
Constructor Details
-
SquareGeometry
Create a square lattice geometry tied to the given engine.- Parameters:
engine- EvoLudo pacemaker
-
-
Method Details
-
parse
Description copied from class:AbstractGeometryParse geometry-specific CLI options.- Overrides:
parsein classAbstractGeometry- Parameters:
arg- the argument string without the geometry key- Returns:
trueif parsing succeeded,falseif invalid
-
warnIfConnectivityProvided
Emit a warning if the user attempts to specify connectivity for a fixed stencil.- Parameters:
numeric- connectivity string passed on the CLI
-
init
public void init()Generates square regular lattices with arbitrary neighbourhood sizes. Variant-specific initializers for standard stencils are available to subclasses.Requirements/notes:
- Population size must be a perfect square \(N=n^2\).
- Admissible connectivities are \(4\) (von Neumann) or \((2m+1)^2-1\) for Moore-type stencils.
- Inter-species interactions add the focal node as a neighbour and allow connectivity \(1\).
- Boundaries are periodic by default but can be fixed.
- Specified by:
initin classAbstractGeometry
-
prepareSquareLattice
protected int prepareSquareLattice()Common setup for square geometries.- Returns:
- the computed side length of the lattice
-
initSquareSelf
Initialize a square lattice that only connects nodes to themselves (used when connectivity equals one).- Parameters:
geometry- geometry receiving the linksside- side length of the (sub) latticefullside- global side lengthoffset- index offset into the population
-
initHierarchicalSquare
public static void initHierarchicalSquare(AbstractGeometry geometry, int popSize, int demeSize, int startIndex, boolean fixedBoundary) Initialize one hierarchical square deme using population and deme sizes.- Parameters:
geometry- geometry receiving the linkspopSize- total population sizedemeSize- number of individuals in the demestartIndex- index offset into the populationfixedBoundary-truefor fixed boundary conditions
-
initSquare
public static void initSquare(AbstractGeometry geometry, int side, int fullside, int offset, boolean fixedBoundary) Initialize a square lattice with arbitrary (odd) neighbourhood sizes.- Parameters:
geometry- geometry receiving the linksside- side length of the (sub) latticefullside- global side lengthoffset- index offset into the populationfixedBoundary-truefor fixed boundary conditions
-
adjustBoundaries
private static void adjustBoundaries(AbstractGeometry geometry, int range, int side, int fullside, int offset, boolean interspecies) Adjust arbitrary-range neighbourhoods along fixed boundaries.- Parameters:
geometry- geometry receiving the linksrange- interaction rangeside- side length of the (sub) latticefullside- global side lengthoffset- index offset into the populationinterspecies-trueif self-links are required
-
checkSettings
protected boolean checkSettings()Description copied from class:AbstractGeometryHook for subclasses to implement geometry specific checks.- Overrides:
checkSettingsin classAbstractGeometry- Returns:
trueif adjustments require a reset
-