/// <summary> /// Checks whether the operator is relevant to the given target conditions. /// </summary> /// <param name="conditions">Target conditions.</param> /// <returns>True if the operator is relevant to the given conditions, false otherwise.</returns> public bool IsRelevant(Planner.IConditions conditions) { return(LiftedOperator.IsRelevant((IConditions)conditions, Substitution)); }
/// <summary> /// Checks whether the operator is relevant to the given target relative state. /// </summary> /// <param name="relativeState">Target relative state.</param> /// <returns>True if the operator is relevant to the given relative state, false otherwise.</returns> public bool IsRelevant(Planner.IRelativeState relativeState) { return(LiftedOperator.IsRelevant((IRelativeState)relativeState, Substitution)); }
/// <summary> /// Checks whether the operator is applicable to the given state. /// </summary> /// <param name="state">Reference state.</param> /// <returns>True if the operator is applicable to the given state, false otherwise.</returns> public bool IsApplicable(Planner.IState state) { return(LiftedOperator.IsApplicable((IState)state, Substitution)); }
/// <summary> /// Applies the operator to the given state. The result is a new state - successor. /// </summary> /// <param name="state">Reference state.</param> /// <param name="directlyModify">Should the input state be directly modified? (otherwise a new node is created)</param> /// <returns>Successor state to the given state.</returns> public Planner.IState Apply(Planner.IState state, bool directlyModify = false) { return(LiftedOperator.Apply((IState)state, Substitution, directlyModify)); }
/// <summary> /// Constructs an instance of the grounded PDDL operator. /// </summary> /// <param name="liftedOperator">Reference to the lifted PDDL operator.</param> /// <param name="substitution">Concrete PDDL operator substitution.</param> public Operator(LiftedOperator liftedOperator, ISubstitution substitution) { LiftedOperator = liftedOperator; Substitution = substitution; }
/// <summary> /// Gets the operator name. /// </summary> /// <returns>Full operator name.</returns> public string GetName() { return(LiftedOperator.GetName(Substitution)); }
/// <summary> /// Gets a list of atoms that are made true by the application of this operator. Only simple positive effects are wanted. /// </summary> /// <returns>List of effective effect atoms.</returns> public List <IAtom> GetEffectiveEffects() { return(LiftedOperator.GetEffectiveEffects(Substitution)); }
/// <summary> /// Gets a list of atoms from the specified state that were necessary to make this operator applicable. We already assume that the operator is applicable to the given state. /// </summary> /// <param name="predecessorState">Preceding state.</param> /// <returns>List of effective precondition atoms.</returns> public List <IAtom> GetEffectivePreconditions(IState predecessorState) { return(LiftedOperator.GetEffectivePreconditions(Substitution, predecessorState)); }
/// <summary> /// Computes the operator label in the relaxed planning graph. /// </summary> /// <param name="stateLabels">Atom labels from the predecessor layer in the graph.</param> /// <param name="evaluationStrategy">Evaluation strategy of the planning graph.</param> /// <returns>Computed operator label in the relaxed planning graph.</returns> public double ComputePlanningGraphLabel(IStateLabels stateLabels, ForwardCostEvaluationStrategy evaluationStrategy) { return(LiftedOperator.ComputePlanningGraphLabel(Substitution, (StateLabels)stateLabels, evaluationStrategy)); }
/// <summary> /// Applies the operator backwards to the given target relative state. The result is a new relative state (or more relative states, if conditional effects are present). /// </summary> /// <param name="relativeState">Target relative state.</param> /// <returns>Preceding relative states.</returns> public IEnumerable <Planner.IRelativeState> ApplyBackwards(Planner.IRelativeState relativeState) { return(LiftedOperator.ApplyBackwards((IRelativeState)relativeState, Substitution)); }
/// <summary> /// Applies the operator backwards to the given target conditions. The result is a new set of conditions. /// </summary> /// <param name="conditions">Target conditions.</param> /// <returns>Preceding conditions.</returns> public Planner.IConditions ApplyBackwards(Planner.IConditions conditions) { return(LiftedOperator.ApplyBackwards((IConditions)conditions, Substitution)); }