Package FAtiMA.Core.plans
Class Effect
java.lang.Object
FAtiMA.Core.plans.Effect
- All Implemented Interfaces:
IGroundable,Serializable,Cloneable
Represents a step's effect. Includes information about the probability of
the effect to succeed in the world.
- Author:
- Joao Dias
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEffect(AgentModel am, String stepName, float prob, Condition effect) Creates a new Effect -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones this effect, returning an equal copy.voidDecreases an effect's probability by a fixed ammount.Gets the condition that represents the EffectfloatGets the effect's probabilityvoidIncreases an effect's probability by a fixed ammount.booleanIndicates 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(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.toString()Converts the Effect to a String
-
Constructor Details
-
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 Details
-
DecreaseProbability
Decreases an effect's probability by a fixed ammount. Used to perform wishfull thinking or denial withing emotion-focused coping strategies -
GetEffect
Gets the condition that represents the Effect- Returns:
- the effect (represented as a condition)
-
GetProbability
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
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:
-
MakeGround
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:
-
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
Increases an effect's probability by a fixed ammount. Used to perform wishfull thinking or denial withing emotion-focused coping strategies -
clone
Clones this effect, returning an equal copy. If this clone is changed afterwards, the original object remains the same. -
toString
Converts the Effect to a String
-