core
Class Identifier

java.lang.Object
  extended by core.Identifier
Direct Known Subclasses:
Bayes, Tree

public abstract class Identifier
extends java.lang.Object

Abstract class Identifier contains common methods for concrete implementations of identifications cores, like Tree or Bayes.

Version:
1.0
Author:
Oscar Flores

Field Summary
 Configuration cnf
          Configuration settings
 Context con
          Current context of execution
 Matrix mat
          Reference matrix
 float sum
          Mantains the sum of all probabilities
 
Constructor Summary
Identifier(Context con, Matrix mat, Configuration cnf)
          Creates a new Identifier with no done tests
 
Method Summary
 int getBestTaxaIndex()
          Returns the index of the taxon with the higher relative probability
 int getBestTestIndex()
          Returns the key of the test with best value (all taxa vs. all others).
 int getBestTestIndex(Context con)
          Returns the key of the test with best value (all taxa vs. all others).
 int getBestTestIndex(int idTaxa)
          Returns the key of the test with best value (one taxon vs. all others).
 int getBestTestIndex(int idTaxa, Context con)
          Returns the key of the test with best value (one taxon vs. all others).
 int[] getTaxaIndex()
          Returns an ordered array (sorted from best to worse) with the index of all alive taxa (the ones which till this moment haven't been discarded)
 int[] getTestIndex()
          Returns an ordered array (sorted from best to worse) with the index of each missed test in order to choose the best one.
 int[] getTestIndex(Context con)
          Returns an ordered array (sorted from best to worse) with the index of each missed test in order to choose the best one.
 int[] getTestIndex(int idTaxa)
          Returns an ordered array (sorted from best to worse) with the index of each missed test in order to choose the best one.
 int[] getTestIndex(int idTaxa, Context con)
          Returns an ordered array (sorted from best to worse) with the index of each missed test in order to choose the best one.
protected  boolean isSeparator(int idTaxa1, int idTaxa2, int idTest)
          Returns true if a given pair of taxa are separated one from the other by the specified test
 float normTaxaProb(int idTaxa)
          Returns the relative probability beetween 0 to 1 of that given taxon is the unknown (wich probability has this taxon to be the unknown and not the other taxa)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cnf

public Configuration cnf
Configuration settings


con

public Context con
Current context of execution


mat

public final Matrix mat
Reference matrix


sum

public float sum
Mantains the sum of all probabilities

Constructor Detail

Identifier

public Identifier(Context con,
                  Matrix mat,
                  Configuration cnf)
Creates a new Identifier with no done tests

Parameters:
con - Context of the execution
mat - Reference matrix
Method Detail

getTaxaIndex

public int[] getTaxaIndex()
Returns an ordered array (sorted from best to worse) with the index of all alive taxa (the ones which till this moment haven't been discarded)

Returns:
Sorted array with alive taxon keys, or null if none

getBestTaxaIndex

public int getBestTaxaIndex()
Returns the index of the taxon with the higher relative probability

Returns:
Index of the best taxon

getTestIndex

public int[] getTestIndex()
Returns an ordered array (sorted from best to worse) with the index of each missed test in order to choose the best one. It uses "all taxa versus all other" comparison and only alive taxa are looked for

Returns:
Sorted array with remaining tests keys, or null if none

getTestIndex

public int[] getTestIndex(Context con)
Returns an ordered array (sorted from best to worse) with the index of each missed test in order to choose the best one. It uses "all taxa versus all other" comparison and only alive taxa are looked for This method use the given Context instead of the one from the Identifier. That could be usefull if we want to get the test for derivate Contexts

Parameters:
con - Reference Context
Returns:
Sorted array with remaining tests keys, or null if none

getTestIndex

public int[] getTestIndex(int idTaxa)
Returns an ordered array (sorted from best to worse) with the index of each missed test in order to choose the best one. It uses "one taxon versus all other" comparison and only alive taxa are looked for

Parameters:
idTaxa - Reference taxon key
Returns:
Sorted array with remaining tests keys, or null if none

getTestIndex

public int[] getTestIndex(int idTaxa,
                          Context con)
Returns an ordered array (sorted from best to worse) with the index of each missed test in order to choose the best one. It uses "one taxon versus all other" comparison and only alive taxa are looked for This method uses the given Context instead of the one from the Identifier. That could be usefull if we want to get the test for derivate Contexts

Parameters:
idTaxa - Reference taxon key
con - Reference Context
Returns:
Sorted array with remaining tests keys, or null if none

getBestTestIndex

public int getBestTestIndex()
Returns the key of the test with best value (all taxa vs. all others). This value is a function of the number of taxa that is separed and the sum of his probabilities.

Returns:
Key of the best test

getBestTestIndex

public int getBestTestIndex(Context con)
Returns the key of the test with best value (all taxa vs. all others). This value is a function of the number of taxa that is separed and the sum of his probabilities. This method uses the given Context instead of the one from the Identifier. That could be usefull if we want to get the test for derivate Contexts

Parameters:
con - Reference Context
Returns:
Key of the best test

getBestTestIndex

public int getBestTestIndex(int idTaxa)
Returns the key of the test with best value (one taxon vs. all others). This value is a function of the number of taxa that is separed and the sum of his probabilities.

Parameters:
idTaxa - Key of the reference taxons
Returns:
Key of the best test

getBestTestIndex

public int getBestTestIndex(int idTaxa,
                            Context con)
Returns the key of the test with best value (one taxon vs. all others). This value is a function of the number of taxa that is separed and the sum of his probabilities. This method uses the given Context instead of the one from the Identifier. That could be usefull if we want to get the test for derivate Contexts

Parameters:
idTaxa - Key of the reference taxons
con - Reference context
Returns:
Key of the best test

normTaxaProb

public float normTaxaProb(int idTaxa)
Returns the relative probability beetween 0 to 1 of that given taxon is the unknown (wich probability has this taxon to be the unknown and not the other taxa)

Parameters:
idTaxa - Key of reference taxon
Returns:
Normalized probability

isSeparator

protected boolean isSeparator(int idTaxa1,
                              int idTaxa2,
                              int idTest)
Returns true if a given pair of taxa are separated one from the other by the specified test

Parameters:
idTaxa1 - Identification of the first taxa
idTaxa2 - Identification of the second taxa
idTest - Identification of the test
Returns:
idTaxa1 is separated from idTaxa2 by the idTest on matrix mat?