Family

class Family<T, S : Vector<S>, A : GeometricTransformation<S>>(comparator: Comparator<Pedestrian<T, S, A>>) : GenericGroup<T, Pedestrian<T, S, A>> , GroupWithLeader<T, Pedestrian<T, S, A>>

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

Constructors

Link copied to clipboard
fun Family(comparator: Comparator<Pedestrian<T, S, A>> = Comparator { a, b -> a.id.compareTo(b.id) })

Functions

Link copied to clipboard
open override fun addMember(node: Pedestrian<T, S, A>): Group<T, Pedestrian<T, S, A>>

Add a node in this group if not already part of it.

Link copied to clipboard
open fun contains(node: Pedestrian<T, S, A>): Boolean

Whether a node belongs to this group or not.

Link copied to clipboard
open override fun removeMember(node: Pedestrian<T, S, A>): Group<T, Pedestrian<T, S, A>>

Remove a node from this group.

Properties

Link copied to clipboard
open override val leader: Pedestrian<T, S, A>

The leader of the group.

Link copied to clipboard
open override val members: List<Pedestrian<T, S, A>>

The list of pedestrians belonging to this group.