Optional height: numberProtected agentAgent position tracking
Protected agentsAgents currently in this environment
Private Readonly configSpatial configuration
Protected Readonly dimensionsEnvironment dimensions
Private distanceDistance calculation function
Private quadtreeQuadtree root for spatial indexing
Static prefixedPrivate calculateCalculate Morton code (Z-order) for a position
Private calculatePrivate circleCheck if circle intersects with bounds
Find agents within radius of position
Get current configuration
Get environment dimensions
Private initializePrivate insertPrivate insertCheck if position is within environment bounds
Protected onProtected onProtected onHook: Handle agent removal
Private optimizePrivate pointCheck if point is within bounds
Private queryPrivate queryRemove agent from environment
Private removeRemove agent from quadtree node
Private removeRemove agent from quadtree
Set custom distance function
Private sortPrivate splitPrivate tryUpdate spatial configuration
Static getGet Chebyshev distance function (max of x,y differences)
Static getGet Euclidean distance function (default)
Static getGet Manhattan distance function
ContinuousSpace - 2D environment with floating-point coordinates
Features:
Educational Context: Represents physical spaces where community members can move freely with precise positioning, such as geographic areas, meeting spaces, or virtual worlds.