getLinkCost method

num? getLinkCost(
  1. T source,
  2. T target
)

Gets the cost of a link between two nodes

Implementation

num? getLinkCost(T source, T target) {
  final links = nodeLinks[source] ?? [];
  for (final link in links) {
    if (link.targetNode == target && link.isActive) {
      return link.linkCost;
    }
  }
  return null;
}