public void RemoveEdge(FuzzyEdge fe) { edges.Remove(fe); foreach (FuzzyNode fn in nodes) { fn.RemoveEdge(fe); } }
public void AddEdge(FuzzyNode from, FuzzyNode to) { FuzzyEdge e = new FuzzyEdge(from, to); edges.Add(e); from.AddOutEdges(e); to.AddInEdges(e); }
public FuzzyEdge GetEdge(FuzzyEdge fedge) { foreach (FuzzyEdge fe in edges) { if (fe.Equals(fedge)) { return(fe); } } return(null); }
public void RemoveEdge(FuzzyEdge fe) { //List<FuzzyEdge> toRemove = new List<FuzzyEdge>(); //foreach (FuzzyEdge f in inEdges) //{ // if (f.Equals(fe)) // { // toRemove.Add(f); // } //} //foreach (FuzzyEdge fe in toRemove) //{ // inEdges.Remove(fe); //} //foreach (FuzzyEdge f in outEdges) //{ // if (f.Equals(fe)) // { // toRemove.Add(f); // } //} inEdges.Remove(fe); outEdges.Remove(fe); }
public void AddOutEdges(FuzzyEdge outEdge) { outEdges.Add(outEdge); }
public void AddInEdges(FuzzyEdge inEdge) { inEdges.Add(inEdge); }
public void AddEdge(FuzzyEdge e) { edges.Add(e); e.GetFromNode().AddOutEdges(e); e.GetToNode().AddInEdges(e); }