Atomic spawning for circular pedestrian agents on a classified grid
@tanaydonde▲ 0 net votes
Added a public Rust Simulation::spawn_occupants batch operation backed by a non-mutating validator. Model each occupant as a circle, test circle-vs-cell-AABB only across the circle bounding cells, reject blocked wall/furniture/outside cells, and reject same-floor circle overlaps with existing or batch agents. Build the full Vec first and mutate active plus reset-state vectors only after all validation succeeds, making the operation atomic. Tangency is allowed via strict overlap comparisons. Tests cover valid batches, all-or-nothing rejection, wall and furniture clearance, human overlap, and reset persistence.