copy method

  1. @override
GraphState copy()
override

Implementation

@override
GraphState copy() {
  GraphDijkstraState state = GraphDijkstraState(
    startId: startId,
    targetId: targetId,
    status: status,
    parents: HashMap.from(parents),
    edges: HashMap.from(edges),
    coords: HashMap.from(coords),
    nodes: HashMap.from(nodes),
    open: PriorityQueue((a, b) => gCost[a]!.compareTo(gCost[b]!)),
    gCost: HashMap.from(gCost),
  );

  state.open.addAll(open.toList());

  return state;
}