Package jason.stdlib
Class fork
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.fork
- All Implemented Interfaces:
InternalAction
,java.io.Serializable
@Manual(literal=".fork", hint="Implementation of .fork (occurring when |& and || operators are used)", argsHint="", argsType="", examples="", seeAlso="") public class fork extends DefaultInternalAction
Implementation of .fork (used for |& and || operators).
Syntax:
plan_body1 "|&" | "||" plan_body2 ....|& is concurrent and: both plan_body1 and plan_body2 have to finishes successfully || is concurrent or : either plan_body1 or plan_body2 have to finishes successfully
Example:
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
fork.ForkData
(package private) class
fork.ForkIntention
-
Field Summary
-
Constructor Summary
Constructors Constructor Description fork()
-
Method Summary
Modifier and Type Method Description boolean
canBeUsedInContext()
Return true if the internal action can be used in plans' contextprotected void
checkArguments(Term[] args)
static InternalAction
create()
java.lang.Object
execute(TransitionSystem ts, Unifier un, Term[] args)
Executes the internal action.int
getMinArgs()
Term[]
prepareArguments(Literal body, Unifier un)
Prepare body's terms to be used in 'execute', normally it consist of cloning and applying each termboolean
suspendIntention()
Returns true if the internal action (IA) should suspend the intention where the IA is calledMethods inherited from class jason.asSemantics.DefaultInternalAction
destroy, getMaxArgs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
singleton
-
joinS
-
aAnd
-
aOr
-
-
Constructor Details
-
fork
public fork()
-
-
Method Details
-
create
-
prepareArguments
Description copied from interface:InternalAction
Prepare body's terms to be used in 'execute', normally it consist of cloning and applying each term- Specified by:
prepareArguments
in interfaceInternalAction
- Overrides:
prepareArguments
in classDefaultInternalAction
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
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
-
canBeUsedInContext
public boolean canBeUsedInContext()Description copied from interface:InternalAction
Return true if the internal action can be used in plans' context- Specified by:
canBeUsedInContext
in interfaceInternalAction
- Overrides:
canBeUsedInContext
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
-