Package FAtiMA.Core.plans
Class Effect
- java.lang.Object
-
- FAtiMA.Core.plans.Effect
-
- All Implemented Interfaces:
IGroundable,java.io.Serializable,java.lang.Cloneable
public class Effect extends java.lang.Object implements IGroundable, java.lang.Cloneable, java.io.Serializable
Represents a step's effect. Includes information about the probability of the effect to succeed in the world.- Author:
- Joao Dias
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Effect(AgentModel am, java.lang.String stepName, float prob, Condition effect)Creates a new Effect
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Clones this effect, returning an equal copy.voidDecreaseProbability(AgentModel am)Decreases an effect's probability by a fixed ammount.ConditionGetEffect()Gets the condition that represents the EffectfloatGetProbability(AgentModel am)Gets the effect's probabilityvoidIncreaseProbability(AgentModel am)Increases an effect's probability by a fixed ammount.booleanisGrounded()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.voidMakeGround(Substitution subst)Applies a set of substitutions to the object, grounding it.voidMakeGround(java.util.ArrayList<Substitution> bindings)Applies a set of substitutions to the object, grounding it.voidReplaceUnboundVariables(int variableID)Replaces all unbound variables in the object by applying a numeric identifier to each one.java.lang.StringtoString()Converts the Effect to a String
-
-
-
Constructor Detail
-
Effect
public Effect(AgentModel am, java.lang.String stepName, float prob, Condition effect)
Creates a new Effect- Parameters:
stepName- - the name of the step that this effect bellongs toprob- - the effect's probabilityeffect- - the condition that represents the effect
-
-
Method Detail
-
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:
ReplaceUnboundVariablesin interfaceIGroundable- Parameters:
variableID- - the identifier to be applied
-
MakeGround
public void MakeGround(java.util.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:
MakeGroundin interfaceIGroundable- Parameters:
bindings- - A list of substitutions of the type "[Variable]/value"- See Also:
Substitution
-
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:
MakeGroundin interfaceIGroundable- Parameters:
subst- - a substitution of the type "[Variable]/value"- See Also:
Substitution
-
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:
isGroundedin interfaceIGroundable- 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 java.lang.Object clone()
Clones this effect, returning an equal copy. If this clone is changed afterwards, the original object remains the same.- Overrides:
clonein classjava.lang.Object- Returns:
- The effects's copy.
-
toString
public java.lang.String toString()
Converts the Effect to a String- Overrides:
toStringin classjava.lang.Object- Returns:
- the converted String
-
-