jildt.tilde
Class bestCandidate
java.lang.Object
jason.asSemantics.DefaultInternalAction
jildt.tilde.bestCandidate
- All Implemented Interfaces:
- jason.asSemantics.InternalAction, java.io.Serializable
public class bestCandidate
- extends jason.asSemantics.DefaultInternalAction
Internal action for selecting the best candidate to form a node in a logical decision tree. When more than
one candidate maximizes its metric, the best candidate is selected randomly. The seed for this selection can
been configured with the literal jildt_settings(randomSeed, Value).
Use:
jildt.tilde.bestCandidate(Cnds, BestCn)
Parameters:
- + candidates (List): A list of lists, where every inner list contains information about a candidate. The
structure is as follows: [[metric0,candidate0],...,[metricn,candidaten]].
- +/- best candidate (Literal): the candidate that maximizes its metric.
Examples:
Assuming that Cnds is equal to the list: [[NaN,clear(X)],[1,clear(Y)],[NaN,on(A,X)],[0.5,on(A,Y)]]
-
jildt.tilde.bestCandidate([[NaN,clear(X)],[1,clear(Y)],[NaN,on(A,X)],[0.5,on(A,Y)]], BestCn)
: BestCn unifies
with the literal clear(Y).
-
jildt.tilde.bestCandidate([[NaN,clear(X)],[1,clear(Y)],[NaN,on(A,X)],[0.5,on(A,Y)]], clear(Y))
: returns true.
-
jildt.tilde.bestCandidate([[NaN,clear(X)],[1,clear(Y)],[NaN,on(A,X)],[1,on(A,Y)]], BestCn)
: BestCn may unify
either with the literal clear(Y) or the literal on(A,Y).
-
jildt.tilde.bestCandidate([[NaN,clear(X)],[1,clear(Y)]], clear(X))
: returns false.
-
jildt.tilde.bestCandidate(Cnds, clear(X), X)
: Throws an exception due to only two arguments are
needed for executing the internal action.
-
jildt.tilde.bestCandidate(clear(Y), BestCn)
: Throws an exception because the first argument
must be a list.
-
jildt.tilde.bestCandidate(Cnds, [clear(X)])
: Throws an exception because the second argument
must be either an unbounded variable or a literal.
- 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 |
bestCandidate
public bestCandidate()
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