jildt.tilde
Class splitExamples
java.lang.Object
jason.asSemantics.DefaultInternalAction
jildt.tilde.splitExamples
- All Implemented Interfaces:
- jason.asSemantics.InternalAction, java.io.Serializable
public class splitExamples
- extends jason.asSemantics.DefaultInternalAction
Internal action to separate the examples that succeed a query Qb from the examples that
do not.
Use:
jildt.tilde.splitExamples(Exs, Qb, Sp).
jildt.tilde.splitExamples(Exs, Qb, [Esu, Ensu]).
Parameters:
- + examples (list): the examples to be separated.
- + query (list): a list of terms is the query that will separate the examples.
- +/- result (list): a list of two elements. The first one is for the examples that succeed Qb.
The second one is for the examples that do not succeed.
Examples: Given the query Qb = [intend(put(X,Y)), clear(X)] and 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,c)), on(a,c),on(z,table),on(b,table),on(c,table),clear(table)], success)).
-
jildt_example(put_label, [intend(put(b,c)), on(a,table),on(z,b),on(b,a),on(c,table),clear(table)], fail)).
-
jildt.tilde.splitExamples([1,2,3], Qb, Sp)
: Sp unifies with the list [[1,2], [3]].
-
jildt.tilde.splitExamples([1,2,3], Qb, [Esu, Ensu])
: Esu unifies with the list [1,2] and
Ensu with the list [3].
-
jildt.tilde.splitExamples([1,2,3], Qb, [Esu, [3]])
: Esu unifies with the list [1,2].
-
jildt.tilde.splitExamples([1,2,3], Qb, [Esu, [2]])
: Returns false.
-
jildt.tilde.splitExamples([1,2,3], Qb, [[3],[1,2]])
: Returns false.
-
jildt.tilde.splitExamples(X, Qb, [[3],[1,2]])
: Throws an exception if X is not a list.
-
jildt.tilde.splitExamples([1,2,3], true, [[3],[1,2]])
: Throws an exception because the second
argument must be a list.
-
jildt.tilde.splitExamples([1,2,3], Qb, 2)
:Throws an exception because the third argument
must be a list.
-
jildt.tilde.splitExamples([1,2,3], Qb, [[3],[1,2],[]])
:Throws an exception because the third
argument must be formed by only two elements.
- 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 |
splitExamples
public splitExamples()
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