Esempio n. 1
0
File: Graph.cs Progetto: rbec/malbec
 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();
 }
Esempio n. 2
0
File: Graph.cs Progetto: rbec/malbec
 public Graph Add(Node node)
 {
   return this;
 }
Esempio n. 3
0
File: Node.cs Progetto: rbec/malbec
 public Subscription(Node node, INode subscriber)
 {
   (Node = node).Outputs.Add(this);
   Subscriber = subscriber;
 }