Package jason.stdlib
Class drop_intention
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.drop_intention
- All Implemented Interfaces:
InternalAction
,java.io.Serializable
- Direct Known Subclasses:
drop_desire
@Manual(literal=".drop_intention(goal)", hint="removes intentions to achieve the referred goal", argsHint="the goal the intentions achieve", argsType="literal", examples=".drop_intention(go(1,3)): removes intentions having a plan with triggering event +!go(1,3) in the agent\'s current circumstance.", seeAlso={"jason.stdlib.intend","jason.stdlib.desire","jason.stdlib.drop_all_desires","jason.stdlib.drop_all_events","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 drop_intention extends DefaultInternalAction
Internal action: .drop_intention(I)
.
Description: removes intentions to achieve goal I from the set of intentions of the agent (suspended intentions are also considered). No event is produced.
Parameters:
- - goal (literal): the goal the intentions achieve.
Example:
-
.drop_intention(go(1,3))
: removes intentions having a plan with triggering event+!go(1,3)
in the agent's current circumstance. -
.drop_intention
: removes the current intention.
-
Field Summary
Fields Modifier and Type Field Description private boolean
resultSuspend
-
Constructor Summary
Constructors Constructor Description drop_intention()
-
Method Summary
Modifier and Type Method Description protected void
checkArguments(Term[] args)
boolean
dropInt(Circumstance C, Literal goal, Unifier un)
Drops an intention based on a goal argument returns true if the current intention is droppedjava.lang.Object
execute(TransitionSystem ts, Unifier un, Term[] args)
Executes the internal action.int
getMaxArgs()
int
getMinArgs()
boolean
suspendIntention()
Returns true if the internal action (IA) should suspend the intention where the IA is calledMethods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, destroy, prepareArguments
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
resultSuspend
private boolean resultSuspend
-
-
Constructor Details
-
drop_intention
public drop_intention()
-
-
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
-
suspendIntention
public boolean suspendIntention()Description copied from interface:InternalAction
Returns true if the internal action (IA) should suspend the intention where the IA is called- Specified by:
suspendIntention
in interfaceInternalAction
- Overrides:
suspendIntention
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
-
dropInt
Drops an intention based on a goal argument returns true if the current intention is dropped
-