Esempio n. 1
0
 /// <summary>
 /// Constructs the preference expression.
 /// </summary>
 /// <param name="preferenceNameId">Preference name ID.</param>
 /// <param name="child">An argument of the expression.</param>
 /// <param name="idManager">ID manager.</param>
 public PreferenceExpression(int preferenceNameId, IExpression child, IdManager idManager)
 {
     PreferenceNameId = preferenceNameId;
     Child            = child;
     IdManager        = idManager;
 }
Esempio n. 2
0
        /// <summary>
        /// Constructs the object from the input data.
        /// </summary>
        /// <param name="inputData">Operator effects input data.</param>
        /// <param name="operatorPreconditions">Operator preconditions.</param>
        /// <param name="idManager">ID manager.</param>
        /// <param name="evaluationManager">Evaluation manager.</param>
        public Effects(InputData.PDDL.Effects inputData, Conditions operatorPreconditions, IdManager idManager, EvaluationManager evaluationManager)
        {
            EffectsBuilder effectsBuilder = new EffectsBuilder(idManager);

            inputData.ForEach(inputEffect => Add(effectsBuilder.Build(inputEffect)));

            EffectsApplier = new Lazy <EffectsApplier>(() => new EffectsApplier(evaluationManager));
            EffectsRelevanceConditionsEvaluator    = new Lazy <EffectsRelevanceConditionsEvaluator>(() => new EffectsRelevanceConditionsEvaluator(this, evaluationManager.GroundingManager));
            EffectsRelevanceRelativeStateEvaluator = new Lazy <EffectsRelevanceRelativeStateEvaluator>(() => new EffectsRelevanceRelativeStateEvaluator(this, evaluationManager.GroundingManager));
            EffectsBackwardsConditionsApplier      = new Lazy <EffectsBackwardsConditionsApplier>(() => new EffectsBackwardsConditionsApplier(operatorPreconditions, this, evaluationManager));
            EffectsBackwardsRelativeStateApplier   = new Lazy <EffectsBackwardsRelativeStateApplier>(() => new EffectsBackwardsRelativeStateApplier(operatorPreconditions, this, evaluationManager));
            EffectsResultAtomsCollector            = new Lazy <EffectsResultAtomsCollector>(() => new EffectsResultAtomsCollector(this, evaluationManager.GroundingManager));
        }
Esempio n. 3
0
 /// <summary>
 /// Constructs the expressions builder.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public ExpressionsBuilder(IdManager idManager)
 {
     IdManager    = idManager;
     TermsBuilder = new Lazy <TermsBuilder>(() => new TermsBuilder(IdManager));
 }
Esempio n. 4
0
 /// <summary>
 /// Constructs the object from the input data.
 /// </summary>
 /// <param name="actions">PDDL actions definition.</param>
 /// <param name="idManager">ID manager.</param>
 /// <param name="evaluationManager">Evaluation manager.</param>
 public LiftedOperators(InputData.PDDL.Actions actions, IdManager idManager, EvaluationManager evaluationManager)
 {
     actions.ForEach(action => Add(new LiftedOperator(action, idManager, evaluationManager)));
 }
Esempio n. 5
0
 /// <summary>
 /// Constructs an empty state.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public State(IdManager idManager)
 {
     IdManager = idManager;
 }
Esempio n. 6
0
 /// <summary>
 /// Constructs the grounding object.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public TermsGrounder(IdManager idManager)
 {
     IdManager = idManager;
 }
Esempio n. 7
0
 /// <summary>
 /// Constructs the literal from the given expression.
 /// </summary>
 /// <param name="predicateAtom">Source predicate expression atom.</param>
 /// <param name="isNegated">Is the literal negated?</param>
 /// <param name="idManager">ID manager.</param>
 public PredicateLiteralCNF(IAtom predicateAtom, bool isNegated, IdManager idManager)
 {
     PredicateAtom = predicateAtom;
     IsNegated = isNegated;
     IdManager = idManager;
 }
Esempio n. 8
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);
            }
        }
Esempio n. 9
0
 /// <summary>
 /// Constructs the atom factory.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public PrimitivesFactory(IdManager idManager)
 {
     IdManager = idManager;
 }
Esempio n. 10
0
 /// <summary>
 /// Constructs the literal from the given expression.
 /// </summary>
 /// <param name="expression">Source expression.</param>
 /// <param name="isNegated">Is the literal negated?</param>
 public PredicateLiteralCNF(PredicateExpression expression, bool isNegated)
 {
     PredicateAtom = expression.PredicateAtom;
     IsNegated = isNegated;
     IdManager = expression.IdManager;
 }
 /// <summary>
 /// Constructs the initial state data builder.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public InitialStateDataBuilder(IdManager idManager)
 {
     IdManager = idManager;
 }
Esempio n. 12
0
 /// <summary>
 /// Construct the parameter.
 /// </summary>
 /// <param name="parameterNameId">Parameter name ID.</param>
 /// <param name="typeNamesIDs">Type names IDs.</param>
 /// <param name="idManager">ID manager.</param>
 public Parameter(int parameterNameId, ICollection <int> typeNamesIDs, IdManager idManager)
 {
     ParameterNameId = parameterNameId;
     TypeNamesIDs    = typeNamesIDs;
     IdManager       = idManager;
 }
Esempio n. 13
0
 /// <summary>
 /// Constructs the state from the specified data.
 /// </summary>
 /// <param name="predicates">Predicates of the state.</param>
 /// <param name="numericFunctions">Numeric function values.</param>
 /// <param name="objectFunctions">Object function values.</param>
 /// <param name="idManager">ID manager.</param>
 public State(HashSet <IAtom> predicates, Dictionary <IAtom, double> numericFunctions, Dictionary <IAtom, int> objectFunctions, IdManager idManager) : this(idManager)
 {
     Predicates       = predicates;
     NumericFunctions = numericFunctions;
     ObjectFunctions  = objectFunctions;
 }
Esempio n. 14
0
 /// <summary>
 /// Constructs an empty relative state.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public RelativeState(IdManager idManager) : base(idManager)
 {
 }
Esempio n. 15
0
 /// <summary>
 /// Constructs the effects builder.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public EffectsBuilder(IdManager idManager)
 {
     IdManager    = idManager;
     TermsBuilder = new Lazy <TermsBuilder>(() => new TermsBuilder(IdManager));
 }
Esempio n. 16
0
 /// <summary>
 /// Constructs the relative state from the specified data.
 /// </summary>
 /// <param name="predicates">Predicates of the state.</param>
 /// <param name="negatedPredicates">Negated predicates of the state.</param>
 /// <param name="numericFunctions">Numeric function values.</param>
 /// <param name="objectFunctions">Object function values.</param>
 /// <param name="idManager">ID manager.</param>
 public RelativeState(HashSet <IAtom> predicates, HashSet <IAtom> negatedPredicates, Dictionary <IAtom, double> numericFunctions, Dictionary <IAtom, int> objectFunctions, IdManager idManager)
     : base(predicates, numericFunctions, objectFunctions, idManager)
 {
     NegatedPredicates = negatedPredicates;
 }
Esempio n. 17
0
 /// <summary>
 /// Constructs the expressions grounder.
 /// </summary>
 /// <param name="termsGrounder">Terms grounder.</param>
 /// <param name="numericExpressionsGrounder">Numeric expressions grounder.</param>
 /// <param name="idManager">ID manager.</param>
 public ExpressionsGrounder(Lazy <TermsGrounder> termsGrounder, Lazy <NumericExpressionsGrounder> numericExpressionsGrounder, IdManager idManager)
 {
     TermsGrounder = termsGrounder;
     NumericExpressionsGrounder = numericExpressionsGrounder;
     IdManager = idManager;
 }
Esempio n. 18
0
 /// <summary>
 /// Constructs the terms builder.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public TermsBuilder(IdManager idManager)
 {
     IdManager = idManager;
 }
Esempio n. 19
0
 /// <summary>
 /// Constructs the predicate expression.
 /// </summary>
 /// <param name="predicateAtom">Predicate atom.</param>
 /// <param name="idManager">ID manager.</param>
 public PredicateExpression(IAtom predicateAtom, IdManager idManager)
 {
     PredicateAtom = predicateAtom;
     IdManager     = idManager;
 }