public override bool IsGoalState(State state) { GraphState current = state as GraphState; if (current == null) { return(false); } foreach (Node node in this.p_Goals) { if (current.Self.Equals(node)) { return(true); } } return(false); }
public override State[] GetSuccessors(State state) { GraphState current = state as GraphState; if (current == null) { return(null); } List <GraphState> successors = new List <GraphState>(); foreach (Edge edge in current.Self.Edges) { successors.Add(new GraphState(edge.Node.Label, edge.Node, edge.Weight)); } this.ExpandedStates.Add(current); return(successors.ToArray()); }