Ejemplo n.º 1
0
 public override void FromContext(int initialCuddIndex, PlanningParser.ActionDefineContext context, IReadOnlyDictionary <string, Predicate> predDict)
 {
     CurrentCuddIndex = initialCuddIndex;
     Name             = context.actionSymbol().GetText();
     GenerateVariableList(context.listVariable());
     GenerateAbstractPredicates(context.actionDefBody(), predDict);
     GeneratePrecondition(context, predDict);
     GenerateEffect(context, predDict);
 }
Ejemplo n.º 2
0
        public static Action FromContext(int initialCuddIndex, PlanningParser.ActionDefineContext context, IReadOnlyDictionary <string, Predicate> predDict)
        {
            Action result = new Action(initialCuddIndex);

            result.Name = context.actionSymbol().GetText();
            result.GenerateVariableList(context.listVariable());
            result.GenerateAbstractPredicates(context.actionDefBody(), predDict);
            result.GeneratePrecondition(context, predDict);
            result.GenerateEffect(context, predDict);
            return(result);
        }
Ejemplo n.º 3
0
        public static string GetFullName(PlanningParser.ActionDefineContext context)
        {
            string        name     = context.actionSymbol().GetText();
            List <string> termList = new List <string>();

            PlanningParser.ListVariableContext listVariableContext = context.listVariable();
            do
            {
                if (listVariableContext.VAR().Count != 0)
                {
                    foreach (var varNode in listVariableContext.VAR())
                    {
                        termList.Add(varNode.GetText());
                    }
                }
                listVariableContext = listVariableContext.listVariable();
            } while (listVariableContext != null);
            return(GetFullName(name, termList));
        }