jildt.tilde
Class findExamples
java.lang.Object
jason.asSemantics.DefaultInternalAction
jildt.tilde.findExamples
- All Implemented Interfaces:
- jason.asSemantics.InternalAction, java.io.Serializable
public class findExamples
- extends jason.asSemantics.DefaultInternalAction
Internal action to find and collect the indexes of training examples corresponding to a plan P.
jildt_examples are stored in a LearningBeliefBase
in agents instance of Learner
interface. Examples are indexed in a sequential way. Indexes in are used to recover the training
examples as literals.
Use:
jildt.tilde.findExamples(P, Exs)
Parameters:
- + plan label (Literal): the label of the plan which will be found the examples.
- +/- examples (list): the training examples that correspond to plan P. The result is a list
with the indexes of the examples
Examples: Given the training examples below.
-
jildt_example(put_label, [intend(put(b,c)), on(a,table),on(z,c),on(b,a),on(c,table),clear(table)], fail)).
-
jildt_example(put_label, [intend(put(b,a)), on(a,c),on(z,table),on(b,table),on(c,table),clear(table)], success)).
-
jildt_example(clr_label, [intend(clear(c)), on(a,c),on(z,b),on(b,a),on(c,table),clear(table)], fail)).
-
jildt_example(put_label, [intend(put(c,b)), on(a,table),on(z,b),on(b,a),on(c,table),clear(table)], fail)).
-
jildt_example(clr_label, [intend(clear(b)), on(a,table),on(z,c),on(b,a),on(c,table),clear(table)], success)).
-
jildt.tilde.findExamples(put_label, Exs)
: Exs unifies with the list [1,2,4].
-
jildt.tilde.findExamples(clr_label, Exs)
: Exs unifies with the list [3,5].
-
jildt.tilde.findExamples(tower, Exs)
: Exs unifies with the list [].
-
jildt.tilde.findExamples(put_label, [4,2,1])
: returns true.
-
jildt.tilde.findExamples(clr_label, [5])
: returns false.
-
jildt.tilde.findExamples(P, Exs, X)
: Throws an exception due to only two arguments are needed for executing
the internal action.
-
jildt.tilde.findExamples(put_label, 1)
: Throws an exception because the second argument must be either a list 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 |
findExamples
public findExamples()
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