public EdgeOnPathFinder( Converter <NodeType, IEnumerable <EdgeType> > edgesOutOf, Converter <EdgeType, NodeType> targetOf, CanCreateNodeData <NodeType> data, IndexedProperty <EdgeType, bool> onPath, Predicate <NodeType> isSink) { this.edgesOutOf = edgesOutOf; this.targetOf = targetOf; isBlocked = data.CreateNodeData <bool>(false); blockedSources = data.CreateNodeData <Set <NodeType> >(null); this.onPath = onPath; this.isSink = isSink; }
public IndexedGraphWrapper(ICollection <Node> nodes, Converter <Node, NodeInfo> infoOfNode, Converter <NodeInfo, ICollection <Node> > sourcesOfNode, IndexedProperty <Node, int> indexOfNode) { info = new NodeInfo[nodes.Count]; this.indexOfNode = indexOfNode; this.sourcesOfNode = sourcesOfNode; //new IndexedProperty<Node,int>(new Dictionary<Node,int>()); int i = 0; foreach (Node node in nodes) { info[i] = infoOfNode(node); indexOfNode[node] = i; i++; } targetsOfNode = new ICollection <int> [info.Length]; }