Ejemplo 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;
 }
Ejemplo 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));
        }
Ejemplo 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));
 }
Ejemplo 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)));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructs an empty state.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public State(IdManager idManager)
 {
     IdManager = idManager;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructs the grounding object.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public TermsGrounder(IdManager idManager)
 {
     IdManager = idManager;
 }
Ejemplo 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;
 }
Ejemplo 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);
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Constructs the atom factory.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public PrimitivesFactory(IdManager idManager)
 {
     IdManager = idManager;
 }
Ejemplo 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;
 }
Ejemplo 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;
 }
Ejemplo 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;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Constructs an empty relative state.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public RelativeState(IdManager idManager) : base(idManager)
 {
 }
Ejemplo 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));
 }
Ejemplo 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;
 }
Ejemplo 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;
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Constructs the terms builder.
 /// </summary>
 /// <param name="idManager">ID manager.</param>
 public TermsBuilder(IdManager idManager)
 {
     IdManager = idManager;
 }
Ejemplo 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;
 }