Package jason.stdlib
Class relevant_plans
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.relevant_plans
- All Implemented Interfaces:
InternalAction
,Serializable
@Manual(literal=".relevant_plans(trigger,plans[,labels])",
hint="gets all relevant plans for some triggering event",
argsHint={"the triggering event, enclosed by { and }","the list of plan terms corresponding to the code of the relevant plans","the list of labels of the plans [optional]"},
argsType={"trigger","list of plan terms","list"},
examples={".relevant_plans({+!go(X,Y)},LP): unifies LP with all plans in the agent\'s plan library that are relevant for the triggering event +!go(X,Y)",".relevant_plans({+!go(X,Y)},LP, LL): same as above but also unifies LL with a list of labels of plans in LP",".relevant_plans({+!_},_,LL): gets the labels of all plans for achievement goals"},
seeAlso={"jason.stdlib.add_plan","jason.stdlib.plan_label","jason.stdlib.remove_plan"})
public class relevant_plans
extends DefaultInternalAction
Internal action: .relevant_plans
.
Description: gets all relevant plans for some triggering event. This internal action is used, for example, to answer "askHow" messages.
Parameters:
- + trigger (trigger): the triggering event, enclosed by { and }.
- - plans (list of plan terms): the list of plan terms corresponding to the code of the relevant plans.
- - labels (list, optional): the list of labels of the plans.
Example:
-
.relevant_plans({+!go(X,Y)},LP)
: unifies LP with a list of all plans in the agent's plan library that are relevant for the triggering event+!go(X,Y)
. -
.relevant_plans({+!go(X,Y)},LP, LL)
: same as above but also unifies LL with a list of labels of plans in LP. -
.relevant_plans({+!_},_,LL)
: gets the labels of all plans for achievement goals.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionexecute
(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.int
int
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, checkArguments, destroy, prepareArguments, suspendIntention
-
Constructor Details
-
relevant_plans
public relevant_plans()
-
-
Method Details
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
in classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgs
in classDefaultInternalAction
-
execute
Description copied from interface:InternalAction
Executes the internal action. It should return a Boolean or an Iterator. A true boolean return means that the IA was successfully executed. An Iterator result means that there is more than one answer for this IA (e.g. see member internal action). - Specified by:
execute
in interfaceInternalAction
- Overrides:
execute
in classDefaultInternalAction
- Throws:
Exception
-