Beispiel #1
0
 public int GetValue(IADTreeNode node, IEvaluateVisitor <int> v, ADTreeContext context)
 {
     if (node.Left == null && node.Right == null)
     {
         return(node.Duration);
     }
     return(node.DurationProvider.GetDuration(v.GetValue(node.Left, v, context), v.GetValue(node.Right, v, context)) + node.Duration);
 }
        public bool GetValue(IADTreeNode node, IEvaluateVisitor <bool> v, ADTreeContext context)
        {
            Random rnd = new Random();

            if (node.Left == null && node.Right == null)
            {
                bool?nb = context.GetNodeOutcome(node.Name);
                return((nb.HasValue) ? nb.Value : Convert.ToBoolean(rnd.Next(1)));
            }

            return(node.StatusProvier.GetStatus(v.GetValue(node.Left, v, context), v.GetValue(node.Right, v, context)));
        }