Package FAtiMA.Core.goals
Class ActivePursuitGoal
java.lang.Object
FAtiMA.Core.goals.Goal
FAtiMA.Core.goals.ActivePursuitGoal
- All Implemented Interfaces:
IPlanningOperator,IGroundable,Serializable,Cloneable
Implements OCC's ActivePursuit goals that have activation
conditions
- Author:
- Joao Dias
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Symbolprotected Floatprotected Integerprotected intprotected Floatprotected booleanprotected Floatstatic final floatFields inherited from class FAtiMA.Core.goals.Goal
_appliedSubstitutions, _baseIOF, _baseIOS, _dynamicIOF, _dynamicIOS, _goalID, _key, _name, ACTIVATIONEVENT, FAILUREEVENT, goalCounter, GOALDROPED, GOALFAILURE, GOALSUCCESS, IMPORTANCEOFFAILURE, IMPORTANCEOFSUCCESS, SUCCESSEVENT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedActivePursuitGoal(Name description) Creates a new ActivePursuitGoal -
Method Summary
Modifier and TypeMethodDescriptionvoidAddCondition(String conditionType, Condition cond) Adds a condition to the goalvoidbooleanChecks an ActivePursuitGoal's failure conditions if at least one of them is verified the goal failsvoidChecks the integrity of the goal.booleanChecks if the operators's preconditions are verified in the current StatebooleanChecks an ActivePursuitGoal's success conditions if all of them are verified the goal succeedsclone()Clones this ActivePursuitGoal, returning an equal copy.booleanCompares this planOperator with another planOperator to see if they are equalgetAgent()Gets the name of the agent that executes the operatorGets the operators's effect with the given IDGets the operator's effectsGets the goal's failure conditionsfloatgetID()Gets the ID of the Operator in the planintgetPlans(AgentModel am) getPrecondition(Integer preconditionID) Gets the operator's precondition with the given IDGets the preconditions of the OperatorGets the goal's preconditionsfloatGets the operator's probability of executionGets the goal's success conditionsfloatvoidvoidMakeGround(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.booleanvoidReplaceUnboundVariables(int variableID) Replaces all unbound variables in the object by applying a numeric identifier to each one.voidSets the operators's ID in the planvoidvoidsetUncertainty(AgentModel am, float uncertainty) voidsetUrgency(float urgency) toString()Converts the ActivePursuitGoal to a StringvoidUpdates the probabilities of the operators's effectsMethods inherited from class FAtiMA.Core.goals.Goal
DecreaseImportanceOfFailure, DecreaseImportanceOfSuccess, generateEventDescription, GenerateGoalStatus, GetActivationEvent, getAppliedSubstitutions, GetCancelEvent, GetFailureEvent, GetImportanceOfFailure, GetImportanceOfSuccess, getKey, getName, GetSuccessEvent, GroundConditionList, IncreaseImportanceOfFailure, IncreaseImportanceOfSuccess, isGrounded, SetImportanceOfFailure, SetImportanceOfSuccessMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface FAtiMA.Core.wellFormedNames.IGroundable
isGroundedMethods inherited from interface FAtiMA.Core.plans.IPlanningOperator
getName
-
Field Details
-
alfa
public static final float alfa- See Also:
-
_active
protected boolean _active -
_failureConditions
-
_preConditions
-
_successConditions
-
_numberOfTries
protected int _numberOfTries -
_probability
-
_probabilityDetermined
protected boolean _probabilityDetermined -
_familiarity
-
_urgency
-
_id
-
_agent
-
_effects
-
-
Constructor Details
-
ActivePursuitGoal
Creates a new ActivePursuitGoal- Parameters:
description- - the goal's name or description
-
ActivePursuitGoal
protected ActivePursuitGoal()
-
-
Method Details
-
AddCondition
Adds a condition to the goal- Specified by:
AddConditionin classGoal- Parameters:
conditionType- - the type of the condition: PreConditions SuccessConditions FailureConditionscond- - the condition to add
-
CheckFailure
Checks an ActivePursuitGoal's failure conditions if at least one of them is verified the goal fails- Returns:
- true if the goal failed, false otherwise
-
CheckIntegrity
Checks the integrity of the goal. For instance it checks if the goal's success conditions are reachable by at least one action in the domain operators. If not it means that the goal will never be achieve and probably is a typo in the goal's definition (or in the actions file)- Specified by:
CheckIntegrityin classGoal- Parameters:
val- - the validator used to check the goal- Throws:
UnreachableGoalException- - thrown if a goal's success conditions can never be achieved because there is no operator with such effects
-
CheckSuccess
Checks an ActivePursuitGoal's success conditions if all of them are verified the goal succeeds- Returns:
- true if the goal succeeded, false otherwise
-
mayContainSelf
public boolean mayContainSelf() -
GetNumberOfTries
public int GetNumberOfTries() -
GetGoalUrgency
public float GetGoalUrgency()- Returns:
- the goal's urgency ranging from 0 (not urgent) to 1 (very urgent)
-
GetProbability
-
SetProbability
-
getUncertainty
-
setUncertainty
-
IncrementNumberOfTries
public void IncrementNumberOfTries() -
GetFailureConditions
Gets the goal's failure conditions- Returns:
- a list with the goal's failure conditions
-
GetSuccessConditions
Gets the goal's success conditions- Returns:
- a list with the goal's success conditions
-
GetPreconditions
Gets the goal's preconditions- Returns:
- a list with the goal's preconditions
-
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- Specified by:
ReplaceUnboundVariablesin classGoal- 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- Specified by:
MakeGroundin classGoal- Parameters:
bindings- - A list of substitutions of the type "[Variable]/value"- See Also:
-
getNameWithCharactersOrdered
-
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- Specified by:
MakeGroundin classGoal- Parameters:
subst- - a substitution of the type "[Variable]/value"- See Also:
-
clone
Clones this ActivePursuitGoal, returning an equal copy. If this clone is changed afterwards, the original object remains the same.- Specified by:
clonein interfaceIPlanningOperator- Overrides:
clonein classObject- Returns:
- The Goal's copy.
-
getPlans
-
toString
Converts the ActivePursuitGoal to a String -
addEffect
-
checkPreconditions
Description copied from interface:IPlanningOperatorChecks if the operators's preconditions are verified in the current State- Specified by:
checkPreconditionsin interfaceIPlanningOperator- Returns:
- true if all preconditions are true according to the current State, false otherwise
-
getProbability
Description copied from interface:IPlanningOperatorGets the operator's probability of execution- Specified by:
getProbabilityin interfaceIPlanningOperator- Returns:
- the operators's probability
-
equals
Description copied from interface:IPlanningOperatorCompares this planOperator with another planOperator to see if they are equal- Specified by:
equalsin interfaceIPlanningOperator- Returns:
- true if the operators have the same ID in a plan
-
getAgent
Description copied from interface:IPlanningOperatorGets the name of the agent that executes the operator- Specified by:
getAgentin interfaceIPlanningOperator- Returns:
- the name of the agent that executes the operator
-
getEffect
Description copied from interface:IPlanningOperatorGets the operators's effect with the given ID- Specified by:
getEffectin interfaceIPlanningOperator- Parameters:
effectID- - the id of the operators's effect- Returns:
- the effect
-
getEffects
Description copied from interface:IPlanningOperatorGets the operator's effects- Specified by:
getEffectsin interfaceIPlanningOperator- Returns:
- an ArrayList with all the operators's effects
-
getID
Description copied from interface:IPlanningOperatorGets the ID of the Operator in the plan- Specified by:
getIDin interfaceIPlanningOperator- Returns:
- - the Operator's ID
-
getPrecondition
Description copied from interface:IPlanningOperatorGets the operator's precondition with the given ID- Specified by:
getPreconditionin interfaceIPlanningOperator- Parameters:
preconditionID- - the id of the operators's precondition- Returns:
- the precondition
-
getPreconditions
Description copied from interface:IPlanningOperatorGets the preconditions of the Operator- Specified by:
getPreconditionsin interfaceIPlanningOperator- Returns:
- an ArrayList with all the Operator's preconditions
-
setID
Description copied from interface:IPlanningOperatorSets the operators's ID in the plan- Specified by:
setIDin interfaceIPlanningOperator- Parameters:
id- - the new operators's ID
-
setUrgency
public void setUrgency(float urgency) -
updateEffectsProbability
Description copied from interface:IPlanningOperatorUpdates the probabilities of the operators's effects- Specified by:
updateEffectsProbabilityin interfaceIPlanningOperator
-