public Node Random(Node node, int count) { var pool = Nodes.Values.Where(n => n != node && n.CompareTo(node) <= 0).ToList(); for (var i = 0; i < count; i++) pool.Add(new ImmutableNode(this, NextId++, true, MonteCarlo.Combination(pool, Math.Min(pool.Count + 1, 2)).Concat(pool.GetRange(pool.Count - i, i)))); return pool.Last(); }
public Graph Add(Node node) { return this; }
public Subscription(Node node, INode subscriber) { (Node = node).Outputs.Add(this); Subscriber = subscriber; }