|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jason.asSemantics.DefaultInternalAction jildt.tilde.execTilde
public class execTilde
Internal action to execute TILDE algorithm for building logical decision trees. Logical
Decision Trees are induced in the same way that ID3 algorithm does. Image below shows an example
of a logical decision tree formed after the examples in left side.
Use:
jildt.tilde.execTilde(P,Tree)
Parameters:
Examples: Given a plan @put_label +!put(X,Y) : true <- move(X,Y).
, and the
next set of examples:
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.execTilde(plan_label, Tree)
: Tree unifies with the list [clear(X),
[clear(Y), [success,[2]], [fail,[1]]], [fail, [3]]. Notice that is a tree like the one show in description.
jildt.tilde.execTilde(plan_label,Tree, X)
: Throws an exception due to only two
arguments are needed for executing the internal action.
jildt.tilde.execTilde(put_label, fail)
: Throws an exception because the second
argument must be a variable.
Constructor Summary | |
---|---|
execTilde()
|
Method Summary | |
---|---|
jason.asSyntax.ListTerm |
bestTest(jason.asSyntax.ListTerm cands,
jason.asSyntax.ListTerm Query,
jason.asSyntax.ListTerm examples)
Finds the best candidate to be part of a tree. |
TildeNode |
buildTree(jason.asSyntax.ListTerm examples,
jason.asSyntax.ListTerm query)
Builds a logical decision tree. |
boolean |
canBeUsedInContext()
|
java.util.ArrayList<jason.asSyntax.Term> |
candsByTerm(jason.asSyntax.Term myTerm,
java.util.HashSet<jason.asSyntax.Term> varsCopy)
Generates a list of candidates based on a Term. |
double |
entropy(jason.asSyntax.ListTerm examples,
jason.asSyntax.ListTerm query)
Calculates Entropy. |
java.lang.Object |
execute(jason.asSemantics.TransitionSystem ts,
jason.asSemantics.Unifier un,
jason.asSyntax.Term[] args)
|
jason.asSyntax.ListTerm |
findExamples(java.lang.String planLabel,
jason.asSemantics.Agent agent,
jason.asSemantics.Unifier un)
Finds and collects the training examples corresponding to a plan. |
double |
gainRatio(jason.asSyntax.ListTerm examples,
jason.asSyntax.ListTerm query)
Calculates Gain Ratio. |
static jason.asSyntax.ListTerm |
getCombinations(jason.asSyntax.Literal belief)
Gets the possible combinations of rmode literals for a given literal. |
jason.asSyntax.ListTerm |
getInitialQuery(jason.asSyntax.Plan plan)
Internal action to form the initial query for building a tree. |
int |
getMaxArgs()
|
int |
getMinArgs()
|
double |
informationGain(jason.asSyntax.ListTerm examples,
jason.asSyntax.ListTerm query)
Calculates Information Gain. |
void |
languageBias(jason.asSyntax.ListTerm trainingExamples,
Learner agent)
Generates the learning language bias after a list of training examples. |
java.lang.String |
mostPopular(jason.asSyntax.ListTerm examples)
Finds the most popular node in case of either a stop criteria cannot be reached, or a tree cannot be built anymore. |
jason.asSyntax.ListTerm |
rho(jason.asSyntax.ListTerm rmodeList,
jason.asSyntax.ListTerm query)
Generates the candidates to be part of a tree. |
java.lang.String |
stopBuild(jason.asSyntax.ListTerm examples)
Checks if a stop criteria has been reached during the tree building. |
Methods inherited from class jason.asSemantics.DefaultInternalAction |
---|
prepareArguments, suspendIntention |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public execTilde()
Method Detail |
---|
public java.lang.Object execute(jason.asSemantics.TransitionSystem ts, jason.asSemantics.Unifier un, jason.asSyntax.Term[] args) throws java.lang.Exception
execute
in interface jason.asSemantics.InternalAction
execute
in class jason.asSemantics.DefaultInternalAction
java.lang.Exception
public jason.asSyntax.ListTerm findExamples(java.lang.String planLabel, jason.asSemantics.Agent agent, jason.asSemantics.Unifier un) throws java.lang.Exception
planLabel
- The label of plan that will the examples looked for.agent
- The agent executing the learning process.un
- The unifier of the current internal action.
java.lang.Exception
public static jason.asSyntax.ListTerm getCombinations(jason.asSyntax.Literal belief) throws jason.asSyntax.parser.ParseException
belief
- A literal where the combinations will be generated from.
jason.asSyntax.parser.ParseException
public void languageBias(jason.asSyntax.ListTerm trainingExamples, Learner agent) throws java.lang.Exception
trainingExamples
- The training examples the language bias will be generated for.agent
- The agent executing the learning process.
java.lang.Exception
public jason.asSyntax.ListTerm getInitialQuery(jason.asSyntax.Plan plan) throws java.lang.Exception
plan
- The plan that the learning process is being executed for.
java.lang.Exception
public TildeNode buildTree(jason.asSyntax.ListTerm examples, jason.asSyntax.ListTerm query) throws java.lang.Exception
examples
- A list of examples for building a tree.query
- The initial query for building a tree.
java.lang.Exception
public java.lang.String stopBuild(jason.asSyntax.ListTerm examples)
examples
- A list of examples for building a tree.
public java.lang.String mostPopular(jason.asSyntax.ListTerm examples)
examples
- A list of examples for building a tree.
public jason.asSyntax.ListTerm bestTest(jason.asSyntax.ListTerm cands, jason.asSyntax.ListTerm Query, jason.asSyntax.ListTerm examples) throws java.lang.Exception
cands
- The candidates to be evaluated.Query
- Initial Query.examples
- A list of examples for building a tree.
java.lang.Exception
public double entropy(jason.asSyntax.ListTerm examples, jason.asSyntax.ListTerm query) throws java.lang.Exception
examples
- The training examples to be evaluated.query
- The query to be evaluated.
java.lang.Exception
public double informationGain(jason.asSyntax.ListTerm examples, jason.asSyntax.ListTerm query) throws java.lang.Exception
examples
- The training examples to be evaluated.query
- The query to be evaluated.
java.lang.Exception
public double gainRatio(jason.asSyntax.ListTerm examples, jason.asSyntax.ListTerm query) throws java.lang.Exception
examples
- The training examples to be evaluated.query
- The query to be evaluated.
java.lang.Exception
public jason.asSyntax.ListTerm rho(jason.asSyntax.ListTerm rmodeList, jason.asSyntax.ListTerm query) throws java.lang.Exception
rmodeList
- The list of rmode statements for generating new literals.query
- The accumulated query before generating of candidates.
java.lang.Exception
public java.util.ArrayList<jason.asSyntax.Term> candsByTerm(jason.asSyntax.Term myTerm, java.util.HashSet<jason.asSyntax.Term> varsCopy) throws jason.asSyntax.parser.ParseException
myTerm
- The term that the candidates will be generated from.varsCopy
- A copy of the bounded variables in an initial query.
jason.asSyntax.parser.ParseException
public int getMinArgs()
getMinArgs
in class jason.asSemantics.DefaultInternalAction
public int getMaxArgs()
getMaxArgs
in class jason.asSemantics.DefaultInternalAction
public boolean canBeUsedInContext()
canBeUsedInContext
in interface jason.asSemantics.InternalAction
canBeUsedInContext
in class jason.asSemantics.DefaultInternalAction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |