data
Class Context

java.lang.Object
  extended by data.Context
All Implemented Interfaces:
java.lang.Cloneable

public class Context
extends java.lang.Object
implements java.lang.Cloneable

The Context object mantains the execution context of an identification process. That's the current alive test and taxa (that haven't been discarded till the moment) and info about realized Test.

Version:
1.0
Author:
Oscar Flores

Field Summary
 boolean[] taxa_live
          Bitmap of undiscarded taxa
 float[] taxa_prob
          Mantains the current probability of all taxa to be the unkwnown
 boolean[] test_done
          Bitmap of done tests
 int[] test_resu
          Mantains at the pos "i" the results of the test "i".
 int[] test_sepa
          Mantains at the pos "i" the number of separated taxa by the "i" test.
 float[] test_valu
          Mantains the goodness of the test "i"
 
Constructor Summary
private Context()
          Private null contstructor
  Context(Matrix m)
          Creates an empty context for the given matrix
  Context(Matrix m, int[] testResRef)
          Creates an initial context from probability matrix.
 
Method Summary
protected  Context clone()
           
 int getBestTaxaIndex()
          Returns the taxon with the best probability (any of them, in case of tie)
 int[][] getIncoValues(Matrix m, Configuration c)
          Return the set of done tests that give an unexpected result for the best taxon founded till this moment A test is unexpected only if it has non-variable probabilities and signal opposite results have been supplied
 int[] sortTaxaByProb()
          Returns the ordered array by descendent probabilities (higest probabilities at the lower array indexes)
 int[] sortTestByVal(int[] arr)
          Given a set of test indexes return the same set sorted by the goodness of the test
 Context[] splitContex(int testId, Matrix m, Configuration cnf)
          Separates the current context in two others, discriminating one from each other using their estimation on the test result with especified identificator
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

test_done

public boolean[] test_done
Bitmap of done tests


test_sepa

public int[] test_sepa
Mantains at the pos "i" the number of separated taxa by the "i" test. See documentation for further details


test_resu

public int[] test_resu
Mantains at the pos "i" the results of the test "i". IMPORTANT!: This has to been sync with the Workspace variable with the same name


test_valu

public float[] test_valu
Mantains the goodness of the test "i"


taxa_prob

public float[] taxa_prob
Mantains the current probability of all taxa to be the unkwnown


taxa_live

public boolean[] taxa_live
Bitmap of undiscarded taxa

Constructor Detail

Context

private Context()
Private null contstructor


Context

public Context(Matrix m,
               int[] testResRef)
Creates an initial context from probability matrix. Also need a pointer (it's implicit in Java's parameter pass) to the result array of the Workspace

Parameters:
m - Reference Matrix
testResRef - Workspace result array, passed as implicit pointer

Context

public Context(Matrix m)
Creates an empty context for the given matrix

Parameters:
m - Reference Matrix
Method Detail

splitContex

public Context[] splitContex(int testId,
                             Matrix m,
                             Configuration cnf)
                      throws DataException
Separates the current context in two others, discriminating one from each other using their estimation on the test result with especified identificator

Parameters:
testId -
Returns:
Key 0 - negative probabilities | Key 1 - positive probabilities
Throws:
DataException

sortTaxaByProb

public int[] sortTaxaByProb()
Returns the ordered array by descendent probabilities (higest probabilities at the lower array indexes)

Returns:
Ordered array with alive taxa

getBestTaxaIndex

public int getBestTaxaIndex()
Returns the taxon with the best probability (any of them, in case of tie)

Returns:
Best taxon key

sortTestByVal

public int[] sortTestByVal(int[] arr)
Given a set of test indexes return the same set sorted by the goodness of the test

Parameters:
arr - Test indexes set
Returns:
ordered set

getIncoValues

public int[][] getIncoValues(Matrix m,
                             Configuration c)
Return the set of done tests that give an unexpected result for the best taxon founded till this moment A test is unexpected only if it has non-variable probabilities and signal opposite results have been supplied

Parameters:
m - Reference matrix
Returns:
array[x][y] meaning taxon x has an inconsistent value for test y

clone

protected Context clone()
                 throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException