Projection Spatial Model
Adapter that exposes an agent-layer ContinuousProjection as a spatial-layer SpatialModel. This is the bridge that lets entity-layer code requiring a LocationIfc (notably MovableResource and the KSLProcess.move() family) operate in the same coordinate space as agent-layer code.
Usage:
val space = ContinuousProjection<MyAgent>(context, 0.0..100.0, 0.0..100.0)
val sm = space.asSpatialModel()
val forklift = MovableResource(parent, sm.location(50.0, 50.0), ...)Behavior:
Distance uses the projection's own metric (Euclidean, with torus wrap if enabled).
compareLocations uses Point2D structural equality.
Locations created via location carry agent-layer Point2D values, retrievable via LocationIfc.toPoint2D.
Scope of the bridge (deliberate limitations):
One-way reuse of geometry, not full integration. The bridge lets entity-layer types share coordinates with the projection, but moving a
MovableResourcedoes not automatically update the projection. Agent positions (projection.moveTo(agent, ...)) and movable-resource positions (movableResource.currentLocation = ...) are independent even when they share coordinates.Each call to ContinuousProjection.asSpatialModel produces a new
ProjectionSpatialModel. Locations created in one are not valid for another. Call once and store the result.
Deeper integration — including a MovableResource whose position is the projection's source of truth — is a separate future track (Phase 4.4 in the design doc).
Types
A LocationIfc backed by an agent-layer Point2D. Created via ProjectionSpatialModel.location; users do not instantiate directly.
Functions
Returns true if firstLocation is the same as secondLocation within the underlying spatial model. This is not object reference equality, but rather whether the locations within the underlying spatial model can be considered spatially (equivalent) according to the model. This may or may not imply that the distance between the locations is zero. No assumptions about distance are implied by true.
Computes the distance between fromLocation and toLocation based on the spatial model's distance metric
Create a location at the given Point2D.
Create a location at the given coordinates.