Package jason.stdlib
Class suspend
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.suspend
- All Implemented Interfaces:
InternalAction
,java.io.Serializable
@Manual(literal=".suspend[(goal)]", hint="suspend goals, i.e., all intentions trying to achieve given goal will stop running until a .resume", argsHint="the goals to be suspended [optional]", argsType="literal", examples={".suspend(go(1,3)): suspends intentions to go to the location 1,3",".suspend: suspends the current intention"}, seeAlso={"jason.stdlib.suspended","jason.stdlib.intend","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"}) public class suspend extends DefaultInternalAction
Internal action:
.suspend(G)
.
Description: suspend goals G, i.e., all intentions trying to achieve G will stop
running until the internal action .resume
change the state of those intentions.
A literal G
is a goal if there is a triggering event +!G
in any plan within
any intention in I, E, PI, or PA.
The meta-event ^!G[state(suspended)]
is produced.
Examples:
-
.suspend(go(1,3))
: suspends intentions to go to the location 1,3. -
.suspend
: suspends the current intention.
-
Field Summary
Fields Modifier and Type Field Description private static Atom
reason
static java.lang.String
SELF_SUSPENDED_INT
static java.lang.String
SUSPENDED_INT
(package private) boolean
suspendIntention
-
Constructor Summary
Constructors Constructor Description suspend()
-
Method Summary
Modifier and Type Method Description protected void
checkArguments(Term[] args)
java.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
-
suspendIntention
boolean suspendIntention -
SUSPENDED_INT
public static final java.lang.String SUSPENDED_INT- See Also:
- Constant Field Values
-
SELF_SUSPENDED_INT
public static final java.lang.String SELF_SUSPENDED_INT- See Also:
- Constant Field Values
-
reason
-
-
Constructor Details
-
suspend
public suspend()
-
-
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
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
-
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
-