net.sf.myra.antree.representation
Class Branch

java.lang.Object
  extended by net.sf.myra.antree.representation.Branch

public class Branch
extends java.lang.Object

Version:
$Revision: 2329 $ $Date:: 2011-08-02 09:57:44#$
Author:
Fernando Esteban Barril Otero

Field Summary
static java.lang.String ENCODER_CLASS
          The property key under which the branch encoder class name is stored.
 
Constructor Summary
Branch(net.sf.myra.datamining.data.Term term)
          Creates a new branch.
 
Method Summary
static Branch[] create(net.sf.myra.datamining.data.Metadata metadata, net.sf.myra.datamining.data.Attribute attribute, java.util.List<net.sf.myra.datamining.data.Instance> instances)
          Returns a branch array for the specified attribute, one branch for each attribute value.
static Branch[] create(net.sf.myra.datamining.data.Metadata metadata, net.sf.myra.datamining.data.ContinuousAttribute attribute, java.util.List<net.sf.myra.datamining.data.Instance> instances)
          Returns a branch array for the specified continuous attribute, one branch for each discrete interval.
static Branch[] create(net.sf.myra.datamining.data.Metadata metadata, net.sf.myra.datamining.data.NominalAttribute attribute)
          Returns a branch array for the specified attribute, one branch for each attribute value.
 int getCode()
          Returns the code of this branch.
 Node getFrom()
          Returns the node where this branch originates.
 net.sf.myra.datamining.data.Term getTerm()
          Returns the term represented by this branch.
 Node getTo()
          Returns the node that this branch leads to.
 void setFrom(Node from)
          Sets the node where this branch originates.
 void setTo(Node to)
          Sets the node that this branch leads to.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ENCODER_CLASS

public static final java.lang.String ENCODER_CLASS
The property key under which the branch encoder class name is stored.

See Also:
Constant Field Values
Constructor Detail

Branch

public Branch(net.sf.myra.datamining.data.Term term)
Creates a new branch.

Parameters:
term - the term represented by the branch.
Method Detail

getFrom

public Node getFrom()
Returns the node where this branch originates.

Returns:
the node where this branch originates.

setFrom

public void setFrom(Node from)
Sets the node where this branch originates. When the origin node is changes, the code of the branch is set to UNDEFINED. Note: This method is not thread safe.

Parameters:
from - the node to set.
See Also:
getCode()

getTo

public Node getTo()
Returns the node that this branch leads to.

Returns:
the node that this branch leads to.

setTo

public void setTo(Node to)
Sets the node that this branch leads to.

Parameters:
to - the node to set.

getTerm

public net.sf.myra.datamining.data.Term getTerm()
Returns the term represented by this branch.

Returns:
the term represented by this branch.

getCode

public int getCode()
Returns the code of this branch. This should be used as the pheromone entry for this branch. If the code of the branch is UNDEFINED, it will be computed. Note: This method is not thread safe.

Returns:
the code of this branch.
See Also:
setFrom(Node)

create

public static Branch[] create(net.sf.myra.datamining.data.Metadata metadata,
                              net.sf.myra.datamining.data.Attribute attribute,
                              java.util.List<net.sf.myra.datamining.data.Instance> instances)
Returns a branch array for the specified attribute, one branch for each attribute value.

Parameters:
metadata - the current data set metadata.
attribute - the attribute to get the values from.
instances - the list of instances.
Returns:
a branch array for the specified attribute, one branch for each attribute value.

create

public static Branch[] create(net.sf.myra.datamining.data.Metadata metadata,
                              net.sf.myra.datamining.data.NominalAttribute attribute)
Returns a branch array for the specified attribute, one branch for each attribute value.

Parameters:
metadata - the metadata object.
attribute - the nominal attribute to get the values from.
Returns:
a branch array for the specified attribute, one branch for each nominal value.

create

public static Branch[] create(net.sf.myra.datamining.data.Metadata metadata,
                              net.sf.myra.datamining.data.ContinuousAttribute attribute,
                              java.util.List<net.sf.myra.datamining.data.Instance> instances)
Returns a branch array for the specified continuous attribute, one branch for each discrete interval.

Parameters:
metadata - the metadata object.
attribute - the continuous attribute to get the values from.
instances - the instances used for creating the discrete intervals.
Returns:
a branch array for the specified continuous attribute, one branch for each discrete interval.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2013. All Rights Reserved.