travel To3D
Move agent from its current 3D position in space to destination at constant velocity. The 3D analog of travelTo.
The traversal takes distance / velocity simulated time units; the projection is updated to interpolated intermediate positions every stepSize coordinate-units of travel so concurrent spatial queries (space.within(...), space.neighborsOf(...)) reflect the moving agent's current 3D position at step granularity.
Pattern (discrete-step continuous motion in 3D):
inner class Drone : Agent("d") {
val script: KSLProcess = process(isDefaultProcess = true) {
travelTo3D(this@Drone, airspace,
destination = Point3D(50.0, 50.0, 30.0),
velocity = 5.0)
}
}Reuses Travel.Defaults.stepSize for the default — the parameter is in coordinate units of travel regardless of dimensionality, so 2D and 3D models share the same notion of spatial step granularity.
Reuses TravelResult — durations, distances, and start/arrival times are scalar regardless of how many dimensions the motion spans.
Edge cases (same as the 2D version):
If
current == destinationthe function returns immediately withdistance == 0.0.If
totalDistance <= stepSize, a single delay-and-snap is used.The final position is set exactly to destination (no floating-point drift).
Limitations (same as the 2D version): uninterruptible; no collision detection; constant velocity per call. See §12.6 of the agent-based-modeling design doc for the deferred interruptible-travel work.
Return
a TravelResult describing the completed motion.
Parameters
the moving agent; must be a member of space's context and already placed somewhere.
the 3D projection in which the motion occurs.
target 3D coordinates.
speed in coordinate-units-per-simulated-time; must be positive.
interpolation interval in coordinate units of travel; must be positive.