/// <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); }
public ActivationBinaryTree(BiTemplate constraint) { Root = new ActivationNode(); Leaves = new List <ActivationNode>() { Root }; Constraint = constraint; }
/// <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); }
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>(); }