Example #1
0
 public void AddEdge(Node from, Node to, int inputIndex, int fromIndex)
 {
     from.AddChild(to, inputIndex, fromIndex);
     to.AddParent(from);
     List<Node> cycle = CheckForCycle.CreatesCycle(to);
     if (cycle != null)
     {
         // remove edge which introduced cycle
         //    RemoveEdge( from, to );
         String msg = "Edge between '" + from.Name + "' and '" + to.Name + "' introduces a cycle in the graph";
         GraphCompilationStatus.HandleError(new HasCycleException(msg, cycle)) ;
     }
 }
Example #2
0
        public void AddEdge(Node from, Node to, int inputIndex, int fromIndex)
        {
            from.AddChild(to, inputIndex, fromIndex);
            to.AddParent(from);
            List <Node> cycle = CheckForCycle.CreatesCycle(to);

            if (cycle != null)
            {
                // remove edge which introduced cycle
                //    RemoveEdge( from, to );
                String msg = "Edge between '" + from.Name + "' and '" + to.Name + "' introduces a cycle in the graph";
                GraphCompilationStatus.HandleError(new HasCycleException(msg, cycle));
            }
        }