Multi-Agent Simulation (Boids)
2026/3/9小于 1 分钟
Multi-Agent Simulation (Boids)
题面
实现二维 Boids(群体)简化规则:对每个 agent,在半径 r 内取邻居平均速度做对齐更新 v_new = v + α (v_avg − v),再 p_new = p + v_new。
Implementation Requirements
- Use only native features (external libraries are not permitted)
- The solve function signature must remain unchanged
- 结果写入
agents_next
Examples
见页面 N=2 示例(r=5.0,α=0.05)。
Constraints
- 1 ≤ N ≤ 100,000;位置/速度为 float32
- Performance: N = 10,000