Пример #1
0
 private void GenerateEffect(PlanningParser.ActionDefineContext context, IReadOnlyDictionary <string, Predicate> predDict)
 {
     PlanningParser.EmptyOrEffectContext emptyOrEffectContext = context.actionDefBody().emptyOrEffect();
     if (emptyOrEffectContext != null)
     {
         PlanningParser.EffectContext effectContext = emptyOrEffectContext.effect();
         if (effectContext != null)
         {
             foreach (var cEffectContext in effectContext.cEffect())
             {
                 var condEffect = GetCondEffect(cEffectContext);
                 _effect.Add(condEffect);
             }
         }
     }
 }
        public static List <Tuple <CUDDNode, Tuple <Predicate, bool>[]> > GetEffect(this PlanningParser.EmptyOrEffectContext context,
                                                                                    IReadOnlyDictionary <string, Predicate> predicateDict, StringDictionary assignment)
        {
            var result = new List <Tuple <CUDDNode, Tuple <Predicate, bool>[]> >();

            if (context != null)
            {
                PlanningParser.EffectContext effectContext = context.effect();
                if (effectContext != null)
                {
                    foreach (var cEffectContext in effectContext.cEffect())
                    {
                        CUDDNode initialCuddNode = CUDD.ONE;
                        CUDD.Ref(initialCuddNode);
                        var condEffect = cEffectContext.GetCondEffectList(initialCuddNode, predicateDict, assignment);
                        result.AddRange(condEffect);
                    }
                }
            }

            return(result);
        }