Class SpatialData
java.lang.Object
de.bsommerfeld.pathetic.engine.pathfinder.spatial.SpatialData
The SpatialData class represents the data associated with a grid region. This data includes a
Bloom filter used to quickly check if a position is within the region and a set of positions that
have been examined by the pathfinder.
-
Constructor Summary
ConstructorsConstructorDescriptionSpatialData(int bloomFilterSize, double bloomFilterFpp) Creates a new SpatialData with the specified Bloom filter settings.SpatialData(PathfinderConfiguration configuration) Creates a new GridRegionData with Bloom filter settings from the provided configuration. -
Method Summary
Modifier and TypeMethodDescriptionbooleanflod(PathPosition pathPosition) First Line of Defence.voidregister(PathPosition pathPosition) Registers a given path position by adding it to the Bloom filter and marking it as examined within the regional positions set.
-
Constructor Details
-
SpatialData
public SpatialData(int bloomFilterSize, double bloomFilterFpp) Creates a new SpatialData with the specified Bloom filter settings.- Parameters:
bloomFilterSize- The size of the Bloom filterbloomFilterFpp- The false positive probability of the Bloom filter
-
SpatialData
Creates a new GridRegionData with Bloom filter settings from the provided configuration.- Parameters:
configuration- The pathfinder configuration containing Bloom filter settings
-
-
Method Details
-
register
Registers a given path position by adding it to the Bloom filter and marking it as examined within the regional positions set.- Parameters:
pathPosition- The position in the path to be registered. It represents a specific location within the grid region.
-
flod
First Line of Defence. This method first checks the bloom filter if it might contain the provided . If true, it performs an expensive containment check on the examined positions.
-