SimpleNeighborhood

A basic implementation of the Neighborhood interface.

Functions

Link copied to clipboard
open override fun add(node: Node<T>): SimpleNeighborhood<T, P>
Link copied to clipboard
open operator override fun contains(node: Node<T>?): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open fun forEach(p0: Consumer<in Node<T>>)
Link copied to clipboard
open override fun getCenter(): Node<T>
Link copied to clipboard
open override fun getNeighbors(): ListSet<out Node<T>>
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): MutableIterator<Node<T>>
Link copied to clipboard
fun <R> Iterable<R>.randomElement(randomGenerator: RandomGenerator): R

Returns a random element of the Iterable using the provided randomGenerator.

Link copied to clipboard
open override fun remove(node: Node<T>): Neighborhood<T>
Link copied to clipboard
fun <R> Iterable<R>.shuffled(randomGenerator: RandomGenerator): Iterable<R>

Fisher–Yates shuffle algorithm using a RandomGenerator. More information on Wikipedia.

Link copied to clipboard
open override fun size(): Int
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String