rgg v1.0.0 RGG.Shared
Link to this section Summary
Functions
This function connects nodes to their appropriate neighbors
This function maps nodes into their appropriate buckets before connection
This function returns the nodes that must be tested in order to connect a node in the graph
This function selects the proper bucket numbers for a node based on it’s x location, y location, and the number of buckets
iex>RGG.Shared.get_bucket_from_node(%RGG.Node{x: 0, y: 0}, 10)
{0, 0}
iex>RGG.Shared.get_bucket_from_node(%RGG.Node{x: 1, y: 0.5}, 10)
{10, 5}
This function calculates the maximum number of buckets we can use when connecting nodes to achieve linear runtime when connecting the nodes.. The only parameter is r as we need to make sure we place nodes within radius r of each other within 1 bucket of each other.
Examples
iex>RGG.Square.calculate_radius_square(1000, 25) |> RGG.Shared.num_buckets()
10
Link to this section Functions
This function connects nodes to their appropriate neighbors
This function maps nodes into their appropriate buckets before connection.
This function returns the nodes that must be tested in order to connect a node in the graph.
This function selects the proper bucket numbers for a node based on it’s x location, y location, and the number of buckets
iex>RGG.Shared.get_bucket_from_node(%RGG.Node{x: 0, y: 0}, 10)
{0, 0}
iex>RGG.Shared.get_bucket_from_node(%RGG.Node{x: 1, y: 0.5}, 10)
{10, 5}
This function calculates the maximum number of buckets we can use when connecting nodes to achieve linear runtime when connecting the nodes.. The only parameter is r as we need to make sure we place nodes within radius r of each other within 1 bucket of each other.
Examples
iex>RGG.Square.calculate_radius_square(1000, 25) |> RGG.Shared.num_buckets()
10