Package jason.stdlib
Class relevant_plans
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.relevant_plans
- All Implemented Interfaces:
InternalAction
,java.io.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:
add_plan
,plan_label
,remove_plan
, Serialized Form
-
Constructor Summary
Constructors Constructor Description relevant_plans()
-
Method Summary
Modifier and Type Method Description java.lang.Object
execute(TransitionSystem ts, Unifier un, Term[] args)
Executes the internal action.int
getMaxArgs()
int
getMinArgs()
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, checkArguments, destroy, prepareArguments, suspendIntention
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
public java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args) throws java.lang.ExceptionDescription 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:
java.lang.Exception
-