jildt
Class parseLearnedCtxt
java.lang.Object
jason.asSemantics.DefaultInternalAction
jildt.parseLearnedCtxt
- All Implemented Interfaces:
- jason.asSemantics.InternalAction, java.io.Serializable
public class parseLearnedCtxt
- extends jason.asSemantics.DefaultInternalAction
Internal action to parse an induced Tree to a list with the learned terms. Success branches
of the tree form a new learned context LC to be changed in a plan. The result is a list of lists,
where every inner list means a conjunction of literals, and the set of this lists means a disjunction
of conjunctions.
Use:
jildt.parseLearnedCtxt(Tree, LC)
Parameters:
- + tree (List): a list of size equal to three. The first element of the list represents the literal
of the node; second and third elements are the left and right nodes, respectively.
- +/- learned context (List): the context obtained after the success branches of the tree. If anything
has been learned, the result will be a list like [[true]].
Examples:
-
jildt.parseLearnedCtxt([clear(X), success, fail], LC)
: LC unifies with the list [[clear(X)]].
-
jildt.parseLearnedCtxt([clear(X), [clear(Y), success, fail], fail], LC)
: LC unifies with
the list [[clear(X),clear(Y)]].
-
jildt.parseLearnedCtxt([fail], LC)
: LC unifies with the list [true].
-
jildt.parseLearnedCtxt([clear(X), [clear(Y), success, fail], fail], [clear(Y)])
: returns
false.
-
jildt.parseLearnedCtxt(Tree, LC, X)
: Throws an exception due to only two arguments are
needed for executing the internal action.
-
jildt.parseLearnedCtxt(fail, LC)
: Throws an exception because the first argument must be
a list.
-
jildt.parseLearnedCtxt([clear(X), success, fail], clear(X))
: Throws an exception because
the second argument must be either an unbounded variable or a list.
- 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 |
parseLearnedCtxt
public parseLearnedCtxt()
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