Package jason.stdlib
Class add_nested_source
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.add_nested_source
- All Implemented Interfaces:
InternalAction
,Serializable
@Manual(literal=".add_nested_source(belief,source,result)",
hint="adds a source annotation to a literal (used in communication)",
argsHint={"the literal where the source is to be added","the source","the resulting unification of the source addition"},
argsType={"literal or list","atom","literal or list"},
examples={".add_nested_source(a,jomi,B): B unifies with a[source(jomi)]",".add_nested_source([a1,a2], jomi, B): B unifies with [a1[source(jomi)], a2[source(jomi)]]",".add_nested_source(a[source(bob)],jomi,B): B unifies with a[source(jomi)[source(bob)]] - i.e., the source for jomi was bob"},
seeAlso="")
public class add_nested_source
extends DefaultInternalAction
Internal action: .add_nested_source
.
Description: adds a source annotation to a literal (used in communication).
Parameters:
- + belief(s) (literal or list): the literal where the source annotation's
source is to be added. If this parameter is a list, all literals in the list
will have the source added.
- + source (atom): the source.
- +/- annotated beliefs(s) (literal or list): this argument
unifies with the result of the source addition.
Examples:
-
.add_nested_source(a,jomi,B)
:B
unifies witha[source(jomi)]
. -
.add_nested_source([a1,a2], jomi, B)
:B
unifies with[a1[source(jomi)], a2[source(jomi)]]
. -
.add_nested_source(a[source(bob)],jomi,B)
:B
unifies witha[source(jomi)[source(bob)]]
, which means `I believe ina
and the source for that is agent jomi, the source for jomi was bob'; bob sent a tell to jomi that sent a tell to me.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Term
addAnnotToList
(Term l, Term source) static InternalAction
create()
execute
(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
-
add_nested_source
public add_nested_source()
-
-
Method Details
-
create
-
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
-
addAnnotToList
-