public virtual void SetWeight(TKey child, TWeight weight) { if (children.ContainsKey(child)) { children[child] = weight; } }
public Vertex AddNeighbor(TWeight weight, TValue to) { var vertex = new Vertex(_graph, to); var edge = new WeightedEdge <TWeight>(this, vertex, weight); return(AddNeighbor(edge, vertex) as Vertex); }
public static List <Weight> CreateWeights(Menu menu) { TWeight I <TWeight>() where TWeight : Weight, new() { var weight = new TWeight(); menu.Add(weight.item); return(weight); } return(new List <Weight> { I <PlayerDistanceWeight>(), I <MouseDistanceWeight>(), I <DealsMostDmgWeight>(), I <TimeToKillWeight>() }); }
public override Node AddChild(TKey child, TWeight weight = default) { if (children.ContainsKey(child)) { return(nodes[child]); } TreeNode node = null; if (nodes.ContainsKey(child)) { node = (TreeNode)nodes[child]; } else { node = new TreeNode(Container, child, Level + 1); } children[child] = weight; return(node); }
public override Node AddChild(TKey child, TWeight weight = default) { if (children.ContainsKey(child)) { return(nodes[child]); } DAGraphNode node = null; if (nodes.ContainsKey(child)) { node = (DAGraphNode)nodes[child]; } else { node = new DAGraphNode(Container, child, Level + 1); } ++node.tracking; children[child] = weight; return(node); }
public WeightWrapper Add(TWeight other) => IsInfinite ? this : WeightWrapper.For((TWeight)Weight.Value.Add(other));
public static WeightWrapper For(TWeight weight) => new WeightWrapper { Weight = weight };
internal WeightedElement(T e, TWeight w) { Element = e; Weight = w; }
public abstract Node AddChild(TKey child, TWeight weight = default);
public void SetWeightArray(float[] v) { TWeight.SetElementsAsFloat(v); }
public float[] ToWeightArray() { return(TWeight.GetElementsAsFloat(Rows * Columns)); }
public void SetWeightAtRow(int row, float[] val) { TWeight.SetElementsAsFloat(val, row, 0); }
public void SetWeightAt(float val, int offset) { TWeight.SetElementAsFloat(val, 0, offset); }
public float GetWeightAt(int offset) { return(TWeight.GetElementAsFloat(0, offset)); }
public void AddEdge(TKey nextVertex, TWeight weight) { Edges.Add(nextVertex, weight); }
public PathEntry([NotNull] T value, TWeight weight) { Value = value; Weight = weight; }