Continuous Volume
A 3D Euclidean projection — the volumetric analog of ContinuousProjection. Each agent in the context has an optional Point3D position; positions are set explicitly via placeAt / moveTo from user code.
Spatial queries use an internal uniform 3D spatial hash: the volume is partitioned into cubic cells of cellSize units, agents are bucketed by the cell their position falls into, and within scans only the cells overlapping the query sphere rather than every agent. nearest uses progressive radius doubling on top of within. Insertion / move / remove are O(1) amortized.
The default cellSize is min(xSize, ySize, zSize) / cellSizeDivisor, where the divisor defaults to 10 (settable on Defaults). For typical UAV-airspace use cases — large horizontal extent, sparse vertical density — the §13.6 Q3 resolution is to start with the direct 3D bucket map and benchmark on a real model before considering an octree. Sparse-layer scenarios still work; they just allocate a Triple-keyed map entry per occupied layer (cheap in absolute terms — Triple of Ints is ~32 bytes plus map overhead).
Boundaries: positions are not enforced to be inside xRange / yRange / zRange — the ranges describe the projection's logical domain but placeAt / moveTo accept any coordinates. When torus is true, distances wrap on all three axes and bucket coordinates wrap accordingly. (A "ground+ceiling" model — wrap horizontally only, hard boundary vertically — should use torus = false and handle the vertical clamp in the user's motion loop.)
Parameters
the context whose agents this projection positions
logical x bounds
logical y bounds
logical z bounds
if true, distances wrap at all three boundaries
cubic-cell side length. Defaults to min(xSize, ySize, zSize) / cellSizeDivisor, or 1.0 for degenerate ranges. Must be positive.
display name
Constructors
Types
Mutable global defaults for ContinuousVolume internals, mirroring ContinuousProjection.Defaults.
Properties
Functions
Distance between two agents. Returns Double.NaN if either agent has no assigned position. Euclidean, or wrapped Euclidean if torus is true.
Distance between two points under this projection's metric (Euclidean, with torus wrap if enabled).
Called by the AgentModel.Context when agent leaves. Default no-op — projections that track per-agent state (positions, edges) typically override to drop their bookkeeping for the departing agent.
Return the position of agent, or null if the agent has no assigned position (never placed, or has left the context).