Spatial Model
Types
Properties
The default initial location.
The default velocity for elements that move within the spatial model
The named locations this spatial model exposes for animation/placement (10.1g). Empty by default; a model that maintains a bounded set of named locations (e.g. ksl.modeling.spatial.DistancesModel) overrides this so those locations are discoverable by the animation inventory before a run. Deliberately not backed by a registry of every constructed AbstractLocation — models may create many transient locations at run time, and retaining them all would leak.
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.
Returns true if firstElement is the same as secondElement within the underlying spatial model. This is not object reference equality, but rather whether the elements 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 elements 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
Computes the distance between fromElement and toElement based on the spatial model's distance metric
Checks if the spatial model contains the supplied element. True indicates that the element is within the spatial model. If the element has already been added to this spatial model then this method should return true
Causes the element to be tracked, held, by the spatial model. The user is responsible for maintaining this list
Subclasses can override this method to provide specific behavior when the element has updated it location. Observers of the spatial model are notified (automatically) after this function is called.