jildt
Class getContext
java.lang.Object
jason.asSemantics.DefaultInternalAction
jildt.getContext
- All Implemented Interfaces:
- jason.asSemantics.InternalAction, java.io.Serializable
public class getContext
- extends jason.asSemantics.DefaultInternalAction
Internal action to get the current context of a plan. When a plan has an empty context, a "true" atom
is returned.
Use:
jildt.getCurrentCtxt(P,C)
Parameters:
- + plan label (Atom): the label of the plan which will be returned the context.
- +/- context (Atom): the context of the plan. true if the context is empty.
Examples:
Given the next plan: @put_label +!put(X,Y) : clear(X) & clear(Y) <- move(X,Y).
-
jildt.getCurrentCtxt(put_label,C)
: C unifies with the atom (clear(X) & clear(Y)).
-
jildt.getCurrentCtxt(put_label,true)
: Returns false.
-
jildt.getCurrentCtxt(put_label,(clear(X) & clear(Y)))
: Returns true.
-
jildt.getCurrentCtxt(put_label, C, B)
: Throws an exception due to only two arguments are needed
for executing the internal action.
-
jildt.getCurrentCtxt(put_label(X,Y), C)
: Throws an exception because the first argument must be
an atom.
-
jildt.getCurrentCtxt(put, 5)
: Throws an exception because the second argument must be either
an atom or an unbounded variable.
- Author:
- Carlos Alberto González-Alarcón, Alejandro Guerra-Hernández, Francisco Grimaldo-Moreno
- See Also:
- Serialized Form
Method Summary |
java.lang.Object |
execute(jason.asSemantics.TransitionSystem ts,
jason.asSemantics.Unifier un,
jason.asSyntax.Term[] args)
|
int |
getMaxArgs()
|
int |
getMinArgs()
|
Methods inherited from class jason.asSemantics.DefaultInternalAction |
canBeUsedInContext, prepareArguments, suspendIntention |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getContext
public getContext()
execute
public java.lang.Object execute(jason.asSemantics.TransitionSystem ts,
jason.asSemantics.Unifier un,
jason.asSyntax.Term[] args)
throws java.lang.Exception
- Specified by:
execute
in interface jason.asSemantics.InternalAction
- Overrides:
execute
in class jason.asSemantics.DefaultInternalAction
- Throws:
java.lang.Exception
getMinArgs
public int getMinArgs()
- Overrides:
getMinArgs
in class jason.asSemantics.DefaultInternalAction
getMaxArgs
public int getMaxArgs()
- Overrides:
getMaxArgs
in class jason.asSemantics.DefaultInternalAction