|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.antree.Graph
public class Graph
Nested Class Summary | |
---|---|
static class |
Graph.Entry
This class is used as the key of an entry in the pheromone matrix. |
static class |
Graph.Vertex
Struct-like class that represents a vertex of the construction graph. |
Field Summary | |
---|---|
protected java.util.Map<java.lang.Integer,Graph.Entry> |
cache
The cache for Entry objects [encoding,entry]. |
protected Heuristic |
heuristic
The heuristic information. |
protected java.util.Map<java.lang.String,java.lang.Integer> |
mapping
The mapping of attribute indexes. |
protected double[][] |
matrix
The (dynamic) pheromone matrix. |
protected double[] |
template
Template pheromone array. |
protected net.sf.myra.datamining.data.Attribute[] |
vertices
The attribute array representing the vertices. |
Constructor Summary | |
---|---|
Graph(net.sf.myra.datamining.data.Metadata metadata,
Heuristic heuristic)
Creates a new Graph instance. |
Method Summary | |
---|---|
void |
evaporate()
Evaporates the pheromone values of each branch by normalising the values. |
protected Graph.Entry |
getEntry(Branch branch)
Returns a correspondent Entry object for the specified
branch. |
java.util.Collection<Graph.Vertex> |
getVertices(Branch branch)
Returns the collection of vertices for the specified branch. |
java.util.Collection<Graph.Vertex> |
getVertices(Branch branch,
java.util.Collection<net.sf.myra.datamining.data.Attribute> used)
Returns the collection of vertices for the specified branch. |
java.lang.String |
stats()
|
void |
update(Tree tree)
Updates the pheromone values of the branches used in the specified tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double[][] matrix
protected java.util.Map<java.lang.Integer,Graph.Entry> cache
Entry
objects [encoding,entry].
protected net.sf.myra.datamining.data.Attribute[] vertices
protected java.util.Map<java.lang.String,java.lang.Integer> mapping
protected double[] template
protected Heuristic heuristic
Constructor Detail |
---|
public Graph(net.sf.myra.datamining.data.Metadata metadata, Heuristic heuristic)
Graph
instance.
metadata
- the current dataset's metadata.heuristic
- the heuristic information.Method Detail |
---|
public java.util.Collection<Graph.Vertex> getVertices(Branch branch)
null
, it returns the collection of vertices at
the start of the graph.
branch
- the current branch being followed.
public java.util.Collection<Graph.Vertex> getVertices(Branch branch, java.util.Collection<net.sf.myra.datamining.data.Attribute> used)
null
, it returns the collection of vertices at
the start of the graph.
branch
- the current branch being followed.used
- the list of used attributes, which cannot be reused.
public void update(Tree tree)
tree
- the tree used to update the pheromone values.public void evaporate()
protected Graph.Entry getEntry(Branch branch)
Entry
object for the specified
branch. Note: This implementation is not thread-safe.
branch
- the branch to return the entry.
Entry
object for the specified
branch.public java.lang.String stats()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |