Ejemplo n.º 1
0
        /// <summary>
        /// Constructs the object from the input data.
        /// </summary>
        /// <param name="inputData">Input data of the planning problem.</param>
        /// <param name="parameters">Parameters of the lifted arguments (null if fully grounded).</param>
        /// <param name="idManager">ID manager.</param>
        /// <param name="evaluationManager">Evaluation manager.</param>
        public Conditions(List <InputData.PDDL.Expression> inputData, Parameters parameters, IdManager idManager, EvaluationManager evaluationManager) : this(evaluationManager)
        {
            ExpressionsBuilder expressionsBuilder = new ExpressionsBuilder(idManager);
            inputData.ForEach(inputExpression => Add(expressionsBuilder.Build(inputExpression)));

            if (parameters != null)
            {
                Parameters = DetermineUsedParameters(parameters);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Visits the given input data node.
        /// </summary>
        /// <param name="data">Input data node.</param>
        public override void PostVisit(InputData.PDDL.WhenEffect data)
        {
            List <PrimitiveEffect> argumentEffects = new List <PrimitiveEffect>();

            for (int i = 0; i < data.Effects.Count; ++i)
            {
                argumentEffects.Add((PrimitiveEffect)EffectsStack.Pop());
            }
            argumentEffects.Reverse();

            ExpressionsBuilder expressionsBuilder = new ExpressionsBuilder(IdManager);
            IExpression        argumentExpression = expressionsBuilder.Build(data.Expression);

            EffectsStack.Push(new WhenEffect(argumentExpression, argumentEffects));
        }