ConnectIfInLineOfSigthOnMap

This rule connects nodes that are within maxRange distance, but only if there are not too many obstacles separating their line of sight. The base idea is that line-of-sight distance and routing distance should not differ "too much", as captured by tolerance. tolerance measures the maximum allowed relative difference between the line-of-sight and the route distance. It's default 0.1 (10%) means that if LOS-distance is more than 10% shorter than route-distance, then the nodes are considered disconnected. Route distance is taken two-ways (to account for one-way roads) and the shortest one is considered (wireless signals do not need to follow one-way roads).

Constructors

Link copied to clipboard
constructor(maxRange: Double, tolerance: Double = 0.1)

Properties

Link copied to clipboard
Link copied to clipboard
val tolerance: Double = 0.1

Functions

Link copied to clipboard
open override fun computeNeighborhood(center: Node<T>, environment: Environment<T, GeoPosition>): Neighborhood<T>

Produces a new neighborhood for specified node considering its position.

Link copied to clipboard

Some rules may require to be evaluated against multiple nodes until the situations gets consistent. For instance, a rule that connects the closest 10 nodes must be evaluated multiple times to get to the correct result (this is because a change in one neighbor may require a disconnection from another node to maintain exactly 10 connections). Most rules do not need such machinery (e.g., connecting to nodes within some statically defined range).

Link copied to clipboard
open override fun toString(): String