本文整理汇总了C#中IEdge.get_Target方法的典型用法代码示例。如果您正苦于以下问题:C# IEdge.get_Target方法的具体用法?C# IEdge.get_Target怎么用?C# IEdge.get_Target使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEdge
的用法示例。
在下文中一共展示了IEdge.get_Target方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddEdge
public override void AddEdge(IEdge e)
{
if (e == null)
{
throw new ArgumentNullException("edge");
}
if (!this.VertexInEdges.ContainsKey(e.get_Source()))
{
throw new VertexNotFoundException("Could not find source vertex");
}
if (!this.VertexInEdges.ContainsKey(e.get_Target()))
{
throw new VertexNotFoundException("Could not find target vertex");
}
base.AddEdge(e);
this.VertexInEdges.get_Item(e.get_Target()).Add(e);
}
示例2: TraverseEdge
protected void TraverseEdge(IEdge e, int i)
{
IVertex v = e.get_Source();
IVertex vertex2 = e.get_Target();
if (this.TestGraph.ContainsChoicePoint(v))
{
if (!this.newFront.Contains(v))
{
double num = 0.0;
double num2 = 0.0;
IEdgeEnumerator enumerator = this.TestGraph.Graph.OutEdges(v).GetEnumerator();
while (enumerator.MoveNext())
{
IEdge edge = enumerator.get_Current();
num += this.TestGraph.Prob(edge) * this.probs.get_Item(edge.get_Target()).get_Item(i - 1);
num2 += this.TestGraph.Cost(edge) + this.costs.get_Item(edge.get_Target()).get_Item(i - 1);
}
this.probs.get_Item(v).Add(num);
this.costs.get_Item(v).Add(num2);
this.newFront.Add(v);
}
}
else if (this.Improving(e, i))
{
this.Strategy.SetChooseEdge(v, i, e);
this.probs.get_Item(v).Add(this.probs.get_Item(vertex2).get_Item(i - 1));
this.costs.get_Item(v).Add(this.TestGraph.Cost(e) + this.costs.get_Item(vertex2).get_Item(i - 1));
this.newFront.Add(v);
}
}
开发者ID:NigelThorne,项目名称:ndependencyinjection,代码行数:30,代码来源:ReachabilityStrategyCalculationAlgorithm.cs
示例3: Improving
protected bool Improving(IEdge e, int i)
{
return this.PerformanceComparer.Compare(this.probs.get_Item(e.get_Target()).get_Item(i - 1), this.TestGraph.Cost(e) + this.costs.get_Item(e.get_Target()).get_Item(i - 1), this.probs.get_Item(e.get_Source()).get_Item(i), this.costs.get_Item(e.get_Source()).get_Item(i));
}
示例4: RemoveEdge
public override void RemoveEdge(IEdge e)
{
if (e == null)
{
throw new ArgumentNullException("edge");
}
base.RemoveEdge(e);
EdgeCollection edges = this.VertexInEdges.get_Item(e.get_Target());
if ((edges == null) || !edges.Contains(e))
{
throw new EdgeNotFoundException();
}
edges.Remove(e);
}
示例5: AddEdge
public virtual void AddEdge(IEdge e)
{
if (e == null)
{
throw new ArgumentNullException("vertex");
}
if (e.GetType() != this.EdgeProvider.get_EdgeType())
{
throw new ArgumentNullException("vertex type not valid");
}
if (!this.VertexOutEdges.ContainsKey(e.get_Source()))
{
throw new VertexNotFoundException("Could not find source vertex");
}
if (!this.VertexOutEdges.ContainsKey(e.get_Target()))
{
throw new VertexNotFoundException("Could not find target vertex");
}
if (!this.AllowParallelEdges && this.ContainsEdge(e.get_Source(), e.get_Target()))
{
throw new ArgumentException("graph does not allow duplicate edges");
}
this.EdgeProvider.UpdateEdge(e);
this.VertexOutEdges.get_Item(e.get_Source()).Add(e);
}
示例6: Relax
internal bool Relax(IEdge e)
{
double d = this.distances.get_Item(e.get_Source());
double b = this.distances.get_Item(e.get_Target());
double w = this.weights.get_Item(e);
if (this.Compare(this.Combine(d, w), b))
{
this.distances.set_Item(e.get_Target(), this.Combine(d, w));
return true;
}
return false;
}
示例7: Visit
public void Visit(IEdge se, int depth)
{
if (depth <= this.maxDepth)
{
if (se == null)
{
throw new ArgumentNullException("se");
}
this.EdgeColors.set_Item(se, 2);
this.OnTreeEdge(se);
IEdgeEnumerator enumerator = this.VisitedGraph.OutEdges(se.get_Target()).GetEnumerator();
while (enumerator.MoveNext())
{
IEdge e = enumerator.get_Current();
if (this.EdgeColors.get_Item(e) == null)
{
this.OnDiscoverTreeEdge(se, e);
this.Visit(e, depth + 1);
}
else
{
if (this.EdgeColors.get_Item(e) == 2)
{
this.OnBackEdge(e);
continue;
}
this.OnForwardOrCrossEdge(e);
}
}
this.EdgeColors.set_Item(se, 1);
this.OnFinishEdge(se);
}
}
示例8: FindReversedEdge
protected IEdge FindReversedEdge(IEdge edge)
{
IEdgeEnumerator enumerator = this.VisitedGraph.OutEdges(edge.get_Target()).GetEnumerator();
while (enumerator.MoveNext())
{
IEdge edge2 = enumerator.get_Current();
if (edge2.get_Target() == edge.get_Source())
{
return edge2;
}
}
return null;
}
示例9: PushFlow
private void PushFlow(IEdge e)
{
EdgeDoubleDictionary dictionary;
IEdge edge;
EdgeDoubleDictionary dictionary2;
IEdge edge2;
VertexDoubleDictionary dictionary3;
IVertex vertex3;
VertexDoubleDictionary dictionary4;
IVertex vertex4;
IVertex vertex = e.get_Source();
IVertex vertex2 = e.get_Target();
double num = Math.Min(this.excessFlow.get_Item(vertex), base.ResidualCapacities.get_Item(e));
(dictionary = base.ResidualCapacities).set_Item(edge = e, dictionary.get_Item(edge) - num);
(dictionary2 = base.ResidualCapacities).set_Item(edge2 = base.ReversedEdges.get_Item(e), dictionary2.get_Item(edge2) + num);
(dictionary3 = this.excessFlow).set_Item(vertex3 = vertex, dictionary3.get_Item(vertex3) - num);
(dictionary4 = this.excessFlow).set_Item(vertex4 = vertex2, dictionary4.get_Item(vertex4) + num);
}