WeightedWalkable<E>.generate constructor
Creates a weighted walkable which generates successors dynamically.
The successors
function is called whenever a node is accessed, and the
roots
function is called whenever the roots are accessed. This allows
for lazy generation of nodes and edges.
Implementation
const factory WeightedWalkable.generate({
required Iterable<(E, double)> Function(E node) successors,
required Iterable<E> Function() roots,
}) = _GeneratedWeightedWalkable<E>;