Class ScalefreeGeometry
Object
AbstractGeometry
AbstractNetwork
ScalefreeGeometry
Scale-free network that samples a power-law degree distribution and then
constructs a matching undirected graph.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doublePower-law exponent used when sampling the degree distribution.Fields inherited from class AbstractNetwork
MAX_TRIALS, rngFields inherited from class AbstractGeometry
connectivity, EMPTY_LINKS, engine, features, in, isInterspecies, isRegular, isRewired, isSingle, isUndirected, isValid, kin, kout, logger, name, network2D, network3D, out, pAddwire, pRewire, size, specs, type -
Constructor Summary
ConstructorsConstructorDescriptionScalefreeGeometry(EvoLudo engine) Create a scale-free geometry tied to the given engine. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanHook for subclasses to implement geometry specific checks.clone()Clone geometry.booleaninthashCode()voidinit()Generates a connected undirected scale-free network by sampling degrees from a power-law distribution and then constructing a matching graph.booleanParse geometry-specific CLI options.private intsampleDegree(RNGDistribution rng, double[] distr) Sample a degree from the given distribution.private static voidswap(int[] array, int a, int b) Swap two entries within an array.Methods inherited from class AbstractNetwork
initGeometryDegreeDistrMethods inherited from class AbstractGeometry
addDirected, addEdgeAt, addLinkAt, addUndirected, alloc, check, clearLinksFrom, clearLinksTo, create, create, decodeGeometry, deriveCompetitionGeometry, displaySingle, encodeGeometry, enforceSize, getAddwire, getConnectivity, getEncodeKey, getFeatures, getLabel, getName, getNetwork2D, getNetwork3D, getRewire, getSize, getSpecs, getType, isConsistent, isGraphConnected, isInterspecies, isLattice, isNeighborOf, isRegular, isRewired, isSingle, isType, isUndirected, isUnique, parse, removeEdgeAt, removeLinkAt, rewire, rewireDirected, rewireEdgeAt, rewireLinkAt, rewireUndirected, setAddwire, setConnectivity, setInterspecies, setName, setNetwork2D, setNetwork3D, setRewire, setSingle, setSize, setType, swapEdges, usage, warn
-
Field Details
-
sfExponent
private double sfExponentPower-law exponent used when sampling the degree distribution.
-
-
Constructor Details
-
ScalefreeGeometry
Create a scale-free 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
-
init
public void init()Generates a connected undirected scale-free network by sampling degrees from a power-law distribution and then constructing a matching graph.- Specified by:
initin classAbstractGeometry
-
sampleDegree
Sample a degree from the given distribution.- Parameters:
rng- random number generatordistr- cumulative distribution of degrees- Returns:
- the sampled degree
-
swap
private static void swap(int[] array, int a, int b) Swap two entries within an array.- Parameters:
array- array whose entries should be swappeda- first indexb- second index
-
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
-
clone
Description copied from class:AbstractGeometryClone geometry.Requirements/notes:
- Overrides:
clonein classAbstractGeometry- Returns:
- clone of geometry
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractGeometry
-
equals
- Overrides:
equalsin classAbstractGeometry
-