UNPKG

@thi.ng/boids

Version:

n-dimensional boids simulation with modular behavior system

16 lines 707 B
import type { Predicate2 } from "@thi.ng/api"; import type { IBoidBehavior, ScalarOrField } from "../api.js"; import type { Boid } from "../boid.js"; /** * Cohesion behavior. Attempts to move boid towards centroid of neighboring * boids within `maxDist`. The behavior itself can be weighted via `weight`. * Neighbors can be filtered via optional `filter` predicate, which receives * current boid as first arg and current neighbor as second. By default all * neighbors are considered. * * @param maxDist * @param weight * @param pred */ export declare const cohesion: (maxDist: ScalarOrField, weight?: ScalarOrField, pred?: Predicate2<Boid>) => IBoidBehavior; //# sourceMappingURL=cohesion.d.ts.map