Private alignmentPrivate cohesionPrivate inputPrivate isPrivate maxPrivate Optional modelPrivate outputPrivate separationPrivate calculatePrivate calculateCalculate boundary avoidance force
Private calculateCalculate cohesion force (steer towards center of neighbors)
Private calculateCalculate separation force (avoid crowding neighbors)
Configure flocking behavior parameters
Optional alignmentOptional cohesionOptional maxOptional separationPrivate decodeDecode ML output to agent action
Private encodeEncode agent state for ML model input
Private generateGenerate mock agent state for training data
Predict next action based on current agent state
Current state of the agent
Promise resolving to the predicted action
Private predictML-based prediction
Private predictRule-based flocking prediction (fallback and training data generation)
Generic flocking behavior ML model Works for birds, fish, crowds, or any swarm behavior