AdaptiveRange

open class AdaptiveRange<T, P : Position<P>> @JvmOverloads constructor(environment: Environment<T, P>, radius: Double, desiredNeighbors: Int, tolerance: Int, minRange: Double = DEFAULT_MINRANGE, maxRange: Double = DEFAULT_MAXRANGE, adjustment: Double = DEFAULT_ADJUSTMENT) : ObservingRangeBasedNetworkModel<T, P, AdaptiveRange.LinkState<P>>

A RangeBasedNetworkModel where each node has its own range, adjusted to keep its number of neighbors close to a target: two nodes are linked when each is within the range of the other, and conditionForRemoval does not hold. Whenever its neighborhood changes, the range of a node converges, by steps of adjustment within minRange and maxRange, until its number of neighbors is within tolerance of desiredNeighbors.

Parameters

environment

the environment whose nodes this model links

radius

the initial range of every node

desiredNeighbors

the preferred number of neighbors

tolerance

if the number of neighbors is smaller than desiredNeighbors - tolerance, the range is increased; if it is higher than desiredNeighbors + tolerance, it is decreased

minRange

the minimum range

maxRange

the maximum range

adjustment

the amount the range is changed by when out of tolerance

Type Parameters

T

concentration type

P

position type

Inheritors

Constructors

Link copied to clipboard
constructor(environment: Environment<T, P>, radius: Double, desiredNeighbors: Int, tolerance: Int, minRange: Double = DEFAULT_MINRANGE, maxRange: Double = DEFAULT_MAXRANGE, adjustment: Double = DEFAULT_ADJUSTMENT)

Types

Link copied to clipboard
object Companion

Default parameters.

Link copied to clipboard
data class LinkState<P>(val position: P, val range: Double, val removalInput: Any?)

The state of a node that its links depend on: its position, its current range, and the removalInput that conditionForRemoval reads, as observed by observeRemovalInputs.

Properties

Link copied to clipboard

The neighborhood of this node, as provided by neighborhoodOf.

Functions

Link copied to clipboard
override fun neighborhoodOf(center: Node<T>): Observable<Neighborhood<T>>

The neighborhood of center, a node of the environment of this model, as an observable of immutable snapshots that emits whenever the neighborhood changes.

Link copied to clipboard
infix fun NetworkModel<*>.shouldEqual(other: NetworkModel<*>)
Link copied to clipboard
override fun toString(): String