本文整理汇总了C#中GraphNode.AddOutputNode方法的典型用法代码示例。如果您正苦于以下问题:C# GraphNode.AddOutputNode方法的具体用法?C# GraphNode.AddOutputNode怎么用?C# GraphNode.AddOutputNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphNode
的用法示例。
在下文中一共展示了GraphNode.AddOutputNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestWalkDirectedCyclicGraph
public void TestWalkDirectedCyclicGraph( )
{
IGraphNode n0 = new GraphNode( "n0", 0 );
IGraphNode n1 = new GraphNode( "n1", 1 );
IGraphNode n2 = new GraphNode( "n2", 2 );
n0.AddOutputNode( n1 );
n1.AddOutputNode( n2 );
n2.AddOutputNode( n0 );
GraphNodeWalker.Walk( new IGraphNode[] { n0 }, new MockVisitor( n0, n1, n2 ) );
}
示例2: TestWalkDirectedAcyclicGraph
public void TestWalkDirectedAcyclicGraph( )
{
IGraphNode n0 = new GraphNode( "n0", 0 );
IGraphNode n1 = new GraphNode( "n1", 1 );
IGraphNode n2 = new GraphNode( "n2", 2 );
IGraphNode n3 = new GraphNode( "n3", 3 );
IGraphNode n4 = new GraphNode( "n4", 4 );
IGraphNode n5 = new GraphNode( "n5", 5 );
IGraphNode n6 = new GraphNode( "n6", 6 );
n0.AddOutputNode( n2 );
n1.AddOutputNode( n2 ); // n2 has two inputs (n0,n1). n1 is not in the start node list
n3.AddInputNode( n2 ); // Should be the same as n2.AddOutputNode( n3 )
n4.AddInputNode( n3 );
n5.AddInputNode( n4 );
n5.AddInputNode( n1 );
n6.AddInputNode( n5 );
GraphNodeWalker.Walk( new IGraphNode[] { n0 }, new MockVisitor( n0, n1, n2, n3, n4, n5, n6 ) );
}
示例3: TestWalkTreeGraph
public void TestWalkTreeGraph( )
{
IGraphNode root = new GraphNode( "root", 0 );
IGraphNode n1 = new GraphNode( "n1", 1 );
IGraphNode n2 = new GraphNode( "n2", 2 );
IGraphNode n3 = new GraphNode( "n3", 3 );
IGraphNode n4 = new GraphNode( "n4", 4 );
IGraphNode n5 = new GraphNode( "n5", 5 );
IGraphNode n6 = new GraphNode( "n6", 6 );
root.AddOutputNode( n1 );
root.AddOutputNode( n2 );
n1.AddOutputNode( n3 );
n1.AddOutputNode( n4 );
n2.AddOutputNode( n5 );
n2.AddOutputNode( n6 );
GraphNodeWalker.Walk( new IGraphNode[] { root }, new MockVisitor( root, n1, n2, n3, n4, n5, n6 ) );
}