Skip to main content

Module parameter_list

Module parameter_list 

Source
Expand description

R-Tree backed parameter list for climate-based biome lookup.

Implements vanilla’s Climate.ParameterList with a flattened R-Tree for cache-efficient nearest-neighbor search. The tree is built once at startup using vanilla’s algorithm, then flattened into a BFS-ordered contiguous array where children of the same parent occupy adjacent indices.

Structs§

BuildEntry 🔒
Build data used during tree construction.
FlatNode 🔒
Compact node for the flattened R-Tree.
ParameterList
A list of biome parameter points with their associated values.

Enums§

RTreeNode 🔒
R-Tree node used during construction only. After building, the tree is flattened into a Vec<FlatNode> for search.

Constants§

CHILDREN_PER_NODE 🔒
Maximum children per tree node. Matches vanilla’s CHILDREN_PER_NODE = 6.

Functions§

build_parameter_space 🔒
Build the bounding box for a set of child nodes.
build_tree 🔒
Build an R-Tree from a list of entries, matching vanilla’s algorithm.
cost 🔒
Calculate the cost of a bounding box (sum of range widths).
expected_children_count 🔒
Compute the expected bucket size from vanilla’s formula.
flatten_tree 🔒
Flatten an R-Tree into a contiguous Vec using BFS ordering.
search_nearest 🔒
Search the flat R-Tree for the nearest leaf to the target.
snapshot_buckets 🔒
Snapshot the current entry order into buckets and compute total cost.
sort_bucket_subtrees 🔒
Sort bucket subtrees by a dimension (absolute=true), matching vanilla’s sort(minBuckets, dimensions, minDimension, true).
sort_entries 🔒
Sort entries by a dimension, with tiebreaking by subsequent dimensions.