Exemplo n.º 1
0
 /// <summary>
 ///     Removes current from leaves list and adds node there instead
 /// </summary>
 /// <param name="current"></param>
 /// <param name="node"></param>
 private void UpdateLeavesList(ActivationNode current, ActivationNode node)
 {
     if (!Leaves.Contains(node))
     {
         Leaves.Add(node);
     }
     Leaves.Remove(current);
 }
Exemplo n.º 2
0
 public ActivationBinaryTree(BiTemplate constraint)
 {
     Root   = new ActivationNode();
     Leaves = new List <ActivationNode>()
     {
         Root
     };
     Constraint = constraint;
 }
Exemplo n.º 3
0
 /// <summary>
 ///     Add a new node on the right of current leaf node and updates list of leaves
 /// </summary>
 /// <param name="current">Leaf not to which we want append</param>
 /// <param name="node">Node to append</param>
 public void AddNodeRight(ActivationNode current, ActivationNode node)
 {
     if (current == node)
     {
         return;
     }
     current.Right = node;
     UpdateLeavesList(current, node);
 }
Exemplo n.º 4
0
 public ActivationNode(ActivationNode left = null, ActivationNode right   = null, bool isDead = false,
                       bool fulfilling     = false, List <Event> subtrace = null)
 {
     Left          = left;
     Right         = right;
     IsDead        = isDead;
     MaxFulfilling = fulfilling;
     Subtrace      = subtrace ?? new List <Event>();
 }