Class Effect

java.lang.Object
FAtiMA.Core.plans.Effect
All Implemented Interfaces:
IGroundable, Serializable, Cloneable

public class Effect extends Object implements IGroundable, Cloneable, Serializable
Represents a step's effect. Includes information about the probability of the effect to succeed in the world.
Author:
Joao Dias
See Also:
  • Constructor Details

    • Effect

      public Effect(AgentModel am, String stepName, float prob, Condition effect)
      Creates a new Effect
      Parameters:
      stepName - - the name of the step that this effect bellongs to
      prob - - the effect's probability
      effect - - the condition that represents the effect
  • Method Details

    • DecreaseProbability

      public void DecreaseProbability(AgentModel am)
      Decreases an effect's probability by a fixed ammount. Used to perform wishfull thinking or denial withing emotion-focused coping strategies
    • GetEffect

      public Condition GetEffect()
      Gets the condition that represents the Effect
      Returns:
      the effect (represented as a condition)
    • GetProbability

      public float GetProbability(AgentModel am)
      Gets the effect's probability
      Returns:
      the effect's probability
    • ReplaceUnboundVariables

      public void ReplaceUnboundVariables(int variableID)
      Replaces all unbound variables in the object by applying a numeric identifier to each one. For example, the variable [x] becomes [x4] if the received ID is 4. Attention, this method modifies the original object.
      Specified by:
      ReplaceUnboundVariables in interface IGroundable
      Parameters:
      variableID - - the identifier to be applied
    • MakeGround

      public void MakeGround(ArrayList<Substitution> bindings)
      Applies a set of substitutions to the object, grounding it. Example: Applying the substitution "[X]/John" in the name "Weak([X])" returns "Weak(John)". Attention, this method modifies the original object.
      Specified by:
      MakeGround in interface IGroundable
      Parameters:
      bindings - - A list of substitutions of the type "[Variable]/value"
      See Also:
    • MakeGround

      public void MakeGround(Substitution subst)
      Applies a set of substitutions to the object, grounding it. Example: Applying the substitution "[X]/John" in the name "Weak([X])" returns "Weak(John)". Attention, this method modifies the original object.
      Specified by:
      MakeGround in interface IGroundable
      Parameters:
      subst - - a substitution of the type "[Variable]/value"
      See Also:
    • isGrounded

      public boolean isGrounded()
      Indicates if the name is grounded (no unbound variables in it's WFN) Example: Stronger(Luke,John) is grounded while Stronger(John,[X]) is not.
      Specified by:
      isGrounded in interface IGroundable
      Returns:
      true if the name is grounded, false otherwise
    • IncreaseProbability

      public void IncreaseProbability(AgentModel am)
      Increases an effect's probability by a fixed ammount. Used to perform wishfull thinking or denial withing emotion-focused coping strategies
    • clone

      public Object clone()
      Clones this effect, returning an equal copy. If this clone is changed afterwards, the original object remains the same.
      Overrides:
      clone in class Object
      Returns:
      The effects's copy.
    • toString

      public String toString()
      Converts the Effect to a String
      Overrides:
      toString in class Object
      Returns:
      the converted String