public class fork extends DefaultInternalAction
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:
Modifier and Type | Class and Description |
---|---|
(package private) class |
fork.ForkData |
(package private) class |
fork.ForkIntention |
Modifier and Type | Field and Description |
---|---|
static Atom |
aAnd |
static Atom |
aOr |
private static Structure |
joinS |
private static InternalAction |
singleton |
Constructor and Description |
---|
fork() |
Modifier and Type | Method and Description |
---|---|
boolean |
canBeUsedInContext()
Return true if the internal action can be used in plans' context
|
protected 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 term
|
boolean |
suspendIntention()
Returns true if the internal action (IA) should suspend the
intention where the IA is called
|
destroy, getMaxArgs
private static InternalAction singleton
private static final Structure joinS
public static final Atom aAnd
public static final Atom aOr
public static InternalAction create()
public Term[] prepareArguments(Literal body, Unifier un)
InternalAction
prepareArguments
in interface InternalAction
prepareArguments
in class DefaultInternalAction
public int getMinArgs()
getMinArgs
in class DefaultInternalAction
protected void checkArguments(Term[] args) throws JasonException
checkArguments
in class DefaultInternalAction
JasonException
public boolean suspendIntention()
InternalAction
suspendIntention
in interface InternalAction
suspendIntention
in class DefaultInternalAction
public boolean canBeUsedInContext()
InternalAction
canBeUsedInContext
in interface InternalAction
canBeUsedInContext
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