Class VonNeumannGeometry
Object
AbstractGeometry
AbstractLattice
SquareGeometry
VonNeumannGeometry
Square lattice with von Neumann neighbourhood (four nearest neighbours).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int[][]Row/column offsets for von Neumann neighbours.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
ConstructorsConstructorDescriptionVonNeumannGeometry(EvoLudo engine) Create a von Neumann square lattice geometry tied to the given engine. -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidadjustBoundaryAt(AbstractGeometry geometry, int side, int fullside, int offset, int row, int col) Remove wrapped von Neumann links for one boundary node.protected booleanHook for subclasses to implement geometry specific checks.voidinit()Generates square regular lattices with arbitrary neighbourhood sizes.static voidinitHierarchicalVonNeumann(AbstractGeometry geometry, int popSize, int demeSize, int startIndex, boolean fixedBoundary) Initialize one hierarchical von Neumann square deme using population and deme sizes.static voidinitVonNeumann(AbstractGeometry geometry, int side, int fullside, int offset, boolean fixedBoundary) Initialize a von Neumann square lattice.booleanParse geometry-specific CLI options.Methods inherited from class SquareGeometry
initHierarchicalSquare, initSquare, initSquareSelf, prepareSquareLattice, warnIfConnectivityProvidedMethods inherited from class AbstractLattice
clone, ensureSquareSize, equalParameters, hashParameters, isFixedBoundary, setFixedBoundary, stripBoundaryMethods inherited from class AbstractGeometry
addDirected, addEdgeAt, addLinkAt, addUndirected, alloc, check, clear, clearLinksFrom, clearLinksTo, create, create, create, decodeGeometry, deriveCompetitionGeometry, displaySingle, encodeGeometry, enforceSize, equals, getAddwire, getCLI, getConnectivity, getEncodeKey, getFeatures, getLabel, getName, getNetwork2D, getNetwork3D, getRewire, getSize, getSpecs, getType, hashCode, 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, similar, swapEdges, usage, warn
-
Field Details
-
NEUMANN_DELTAS
private static final int[][] NEUMANN_DELTASRow/column offsets for von Neumann neighbours.
-
-
Constructor Details
-
VonNeumannGeometry
Create a von Neumann 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 classSquareGeometry- Parameters:
arg- the argument string without the geometry key- Returns:
trueif parsing succeeded,falseif invalid
-
init
public void init()Description copied from class:SquareGeometryGenerates 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.
- Overrides:
initin classSquareGeometry
-
initHierarchicalVonNeumann
public static void initHierarchicalVonNeumann(AbstractGeometry geometry, int popSize, int demeSize, int startIndex, boolean fixedBoundary) Initialize one hierarchical von Neumann 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
-
initVonNeumann
public static void initVonNeumann(AbstractGeometry geometry, int side, int fullside, int offset, boolean fixedBoundary) Initialize a von Neumann square lattice.- Parameters:
geometry- geometry receiving the linksside- side length of the (sub) latticefullside- global side lengthoffset- index offset into the populationfixedBoundary-truefor fixed boundary conditions
-
adjustBoundaryAt
private static void adjustBoundaryAt(AbstractGeometry geometry, int side, int fullside, int offset, int row, int col) Remove wrapped von Neumann links for one boundary node.- Parameters:
geometry- geometry receiving the linksside- side length of the (sub) latticefullside- global side lengthoffset- index offset into the populationrow- boundary rowcol- boundary column
-
checkSettings
protected boolean checkSettings()Description copied from class:AbstractGeometryHook for subclasses to implement geometry specific checks.- Overrides:
checkSettingsin classSquareGeometry- Returns:
trueif adjustments require a reset
-