Package jason.stdlib
Class current_intention
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.current_intention
- All Implemented Interfaces:
InternalAction
,Serializable
@Manual(literal=".current_intention(description)",
hint="returns a description of the current intention",
argsHint="the variable that unifies with the intention description",
argsType="structure",
examples=".current_intention(X): X unifies with the description of the current intention",
seeAlso={"jason.stdlib.intend","jason.stdlib.desire","jason.stdlib.intention","jason.stdlib.drop_all_desires","jason.stdlib.drop_all_events","jason.stdlib.drop_all_intentions","jason.stdlib.drop_event","jason.stdlib.drop_intention","jason.stdlib.drop_desire","jason.stdlib.succeed_goal","jason.stdlib.fail_goal","jason.stdlib.resume","jason.stdlib.suspend","jason.stdlib.suspended"})
public class current_intention
extends DefaultInternalAction
Internal action: .current_intention
.
Description: returns a description of the current intention. It is useful
for plans that need to inspect the current intention. The description of the
intention has the following form:
intention(id,stack of intended means)
where each intended means has the form:
im(plan label,trigger event,plan body term, unification function (a list of maps))
For example:
intention(1,
[
im(l__6[source(self)], {+!g3}, { .current_intention(I); .print(end) }, [map(I, ....)]),
im(l__5[source(self)], {+!g5(10)}, { !g3; .fail }, []),
im(l__4[source(self)], {+!start}, { !g5(X); .print(endg4) }, [map(X, test)]),
...
])
Parameters:
- - intention (structure): the variable that unifies with the intention description.
Example:
-
.current_intention(X)
:X
unifies with the description of the current intention (i.e. the intention that executed this internal action).
Notes:
- The internal action .intention(ID,State,Stack,current) can be used in place of .current_intention.
- In case this internal action is used in the body of a plan, the intention that are executing the plan is used.
- In case this internal action is used in the context of a plan, the intention that produced the event is used.
- 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
-
current_intention
public current_intention()
-
-
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
-