Package jason.stdlib
Class suspend
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.suspend
- All Implemented Interfaces:
InternalAction
,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.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkArguments
(Term[] args) execute
(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.int
int
boolean
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
-
Field Details
-
SUSPENDED_INT
- See Also:
-
SELF_SUSPENDED_INT
- See Also:
-
-
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
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
-
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
-