|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjason.asSemantics.DefaultInternalAction
jason.stdlib.wait
public class wait
Internal action: .wait(E,T)
.
Description: suspend the intention for the time specified by T (in
milliseconds) or until some event E happens. The events follow the
AgentSpeak syntax but are enclosed by { and }, e.g. {+bel(33)}
,
{+!go(X,Y)}
.
Parameters:
Examples:
.wait(1000)
: suspend the intention for 1 second.
.wait({+b(1)})
: suspend the intention until the belief
b(1)
is added in the belief base.
.wait({+!g}, 2000)
: suspend the intention until the goal
g
is triggered or 2 seconds have passed, whatever happens
first. In case the event does not happens in two seconds, the internal action
fails.
.wait({+!g}, 2000, EventTime)
: suspend the intention until the goal
g
is triggered or 2 seconds have passed, whatever happens
first.
As this use of .wait has three arguments, in case the event does not happen in
two seconds, the internal action does not fail (as in the previous example).
The third argument will be unified to the
elapsed time (in miliseconds) from the start of .wait until the event or timeout.
at
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
waitAtom
|
Constructor Summary | |
---|---|
wait()
|
Method Summary | |
---|---|
boolean |
canBeUsedInContext()
Return true if the internal action can be used in plans' context |
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 called |
Methods inherited from class jason.asSemantics.DefaultInternalAction |
---|
checkArguments, prepareArguments |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String waitAtom
Constructor Detail |
---|
public wait()
Method Detail |
---|
public boolean canBeUsedInContext()
InternalAction
canBeUsedInContext
in interface InternalAction
canBeUsedInContext
in class DefaultInternalAction
public boolean suspendIntention()
InternalAction
suspendIntention
in interface InternalAction
suspendIntention
in class DefaultInternalAction
public int getMinArgs()
getMinArgs
in class DefaultInternalAction
public int getMaxArgs()
getMaxArgs
in class DefaultInternalAction
public java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args) throws java.lang.Exception
InternalAction
execute
in interface InternalAction
execute
in class DefaultInternalAction
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |