Family

class Family<T>(comparator: Comparator<Node<T>> = Comparator { a, b -> a.id.compareTo(b.id) }) : GenericGroup<T, Node<T>> , GroupWithLeader<T, Node<T>>

A Family is modeled as a group of pedestrians with a leader.

Constructors

Link copied to clipboard
constructor(comparator: Comparator<Node<T>> = Comparator { a, b -> a.id.compareTo(b.id) })

Properties

Link copied to clipboard
open override val leader: Node<T>

The leader of the group.

Link copied to clipboard
open val members: List<Node<T>>

The list of pedestrians belonging to this group.

Link copied to clipboard
open override val size: Int

Functions

Link copied to clipboard
open override fun add(element: Node<T>): Boolean
open override fun add(index: Int, element: Node<T>)
Link copied to clipboard
open override fun addAll(elements: Collection<Node<T>>): Boolean
open override fun addAll(index: Int, elements: Collection<Node<T>>): Boolean
Link copied to clipboard
fun addMember(node: Node<T>): Boolean

adds node to the group if not already added.

Link copied to clipboard
open override fun clear()
Link copied to clipboard
open operator override fun contains(element: Node<T>): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<Node<T>>): Boolean
Link copied to clipboard

Given a non-empty list of points represented as vectors, this method finds the extreme coordinates (i.e. min and max coordinates) on the X-axis, these are used to create the returned ClosedRange.

Link copied to clipboard

Given a non-empty list of points represented as vectors, this method finds the extreme coordinates (i.e. min and max coordinates) on the Y-axis, these are used to create the returned ClosedRange.

Link copied to clipboard
open fun forEach(p0: Consumer<in Node<T>>)
Link copied to clipboard
open operator override fun get(index: Int): Node<T>
Link copied to clipboard
open override fun indexOf(element: Node<T>): 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
open override fun lastIndexOf(element: Node<T>): Int
Link copied to clipboard
open override fun listIterator(): MutableListIterator<Node<T>>
open override fun listIterator(index: Int): MutableListIterator<Node<T>>
Link copied to clipboard
open fun parallelStream(): Stream<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(element: Node<T>): Boolean
Link copied to clipboard
open override fun removeAll(elements: Collection<Node<T>>): Boolean
Link copied to clipboard
open override fun removeAt(index: Int): Node<T>
Link copied to clipboard
open fun removeIf(p0: Predicate<in Node<T>>): Boolean
Link copied to clipboard
fun removeMember(node: Node<T>): Boolean

removes, if present, node from the group.

Link copied to clipboard
open fun replaceAll(p0: UnaryOperator<Node<T>>)
Link copied to clipboard
open override fun retainAll(elements: Collection<Node<T>>): Boolean
Link copied to clipboard
open operator override fun set(index: Int, element: Node<T>): Node<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 fun sort(p0: Comparator<in Node<T>>)
Link copied to clipboard
open override fun spliterator(): Spliterator<Node<T>>
Link copied to clipboard
open fun stream(): Stream<Node<T>>
Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): MutableList<Node<T>>
Link copied to clipboard
fun <T> List<T>.takeFraction(percentage: Double): List<T>

Takes the first percentage * size elements of the list.

Link copied to clipboard
open fun <T : Any> toArray(p0: IntFunction<Array<T>>): Array<T>