Package jason.stdlib
Class intend
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.intend
- All Implemented Interfaces:
InternalAction
,Serializable
- Direct Known Subclasses:
desire
@Manual(literal=".intend(goal[,intention])",
hint="checks if the referred goal is intended, optionally unify with the intention that contains the goal",
argsHint={"the goal to be checked","the intention that contains the goal [optional]"},
argsType={"literal","term"},
examples={".intend(go(1,3)): is true if a plan with triggering event +!go(1,3) appears in an intention of the agent",".intend(go(1,3),I): same, but I unifies with the intention that contains the goal"},
seeAlso={"jason.stdlib.desire","jason.stdlib.drop_all_desires","jason.stdlib.drop_all_events","jason.stdlib.drop_all_intentions","jason.stdlib.drop_intention","jason.stdlib.drop_desire","jason.stdlib.succeed_goal","jason.stdlib.fail_goal","jason.stdlib.intention","jason.stdlib.resume","jason.stdlib.suspend","jason.stdlib.suspended"})
public class intend
extends DefaultInternalAction
Internal action: .intend(G, [ I ] )
.
Description: checks if goal G is intended: G is intended
if there is a triggering event +!G
in any plan within an
intention I; just note that intentions can appear in E (list of events), PA (intentions with pending actions),
and PI (intentions waiting for something) as well.
This internal action backtracks all values for G.
Example:
-
.intend(go(1,3))
: is true if a plan with triggering event+!go(1,3)
appears in an intention of the agent. -
.intend(go(1,3),I)
: as above andI
unifies with the intention that contains the goal.I
is the identification of the intention. The internal action .intention can be used to further inspect the state of the intention.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallIntentions
(Circumstance C, Literal l, Term intID, Unifier un, boolean considerSuspended) returns all unifications for intentions with some goalprotected void
checkArguments
(Term[] args) execute
(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.int
int
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, destroy, prepareArguments, suspendIntention
-
Constructor Details
-
intend
public intend()
-
-
Method Details
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
in classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgs
in classDefaultInternalAction
-
checkArguments
- Overrides:
checkArguments
in classDefaultInternalAction
- Throws:
JasonException
-
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
-
allIntentions
public static Iterator<Unifier> allIntentions(Circumstance C, Literal l, Term intID, Unifier un, boolean considerSuspended) returns all unifications for intentions with some goal
-