|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectunbbayes.prs.bn.PotentialTable
public abstract class PotentialTable
Tabela de Potencial.
| Field Summary | |
|---|---|
protected FloatCollection |
dataCopy
Copy of the data from the data. |
protected FloatCollection |
dataMarginal
The data from the table as a list of floats. |
protected FloatCollection |
dataPT
The data from the table as a list of floats. |
static int |
DIVISION_OPERATOR
|
protected int[] |
factorsMarginal
Factors used to convert linear coordinates in multidimensional ones. |
protected int[] |
factorsPT
Factors used to convert linear coordinates in multidimensional ones. |
static int |
MINUS_OPERATOR
|
static int |
PLUS_OPERATOR
|
static int |
PRODUCT_OPERATOR
|
protected List<Node> |
variableList
RVs that are in the table, including the variable that owns the table. |
| Constructor Summary | |
|---|---|
PotentialTable()
Initialize data and variables. |
|
| Method Summary | |
|---|---|
void |
addValueAt(int index,
float value)
|
void |
addVariable(INode variavel)
Inserts a variable into function. |
Object |
clone()
Returns a copy of the data from the table. |
Object |
clone(ProbabilisticNode newNode)
Returns a copy of the data from the table associated with the new node, instead of the original node. |
List<Node> |
cloneVariables()
Returns a copy of the variables in this table. |
protected void |
computeFactors()
Calculate the factors necessary to transform the linear coordinate into a multidimensional one, which is a list containing the state of each variable in the table. |
protected void |
computeFactorsMarginal()
Calculate the factors necessary to transform the linear coordinate into a multidimensional one, which is a list containing the state of each variable in the table. |
void |
copyData()
Creates a copy of the data from the table. |
void |
directOpTab(PotentialTable tab,
int operator)
Operates with the argument table directly. |
protected void |
finding(int control,
int index,
int[] coord,
int state)
|
int |
getLinearCoord(int[] multidimensionalCoord)
Get the linear coordinate from the multidimensional one. |
int |
getLinearCoordMarginal(int[] multidimensionalCoord)
Get the linear coordinate from the multidimensional one. |
int[] |
getMultidimensionalCoord(int linearCoord)
Get the multidimensional coordinate from the linear one. |
int[] |
getMultidimensionalCoordMarginal(int linearCoord)
Get the multidimensional coordinate from the linear one. |
float |
getValue(int index)
Retorna o valor da cÔøΩlula com o respectivo ÔøΩndice. |
float |
getValue(int[] coordenadas)
Retorna o valor na tabela a partir do vetor de coordenadas |
INode |
getVariableAt(int index)
Obtains a variable (node) associated with this function |
int |
getVariableIndex(Node variable)
|
int |
getVariablesSize()
|
int |
indexOfVariable(Node node)
|
int |
indexOfVariable(String nodeName)
|
void |
moveVariableWithoutMoveData(int initialPosition,
int destinationPosition)
Move a variable of position. |
abstract PotentialTable |
newInstance()
Returns a new instance of a PotentialTable of the current implemented sub-class. |
void |
notifyModification()
This method has to be called when there is a change in any of the variables in this function. |
void |
opTab(PotentialTable tab,
int operator)
Opera tabela do parametro com esta. |
void |
removeValueAt(int index)
|
abstract void |
removeVariable(INode variable)
Remove the variable from this function. |
abstract void |
removeVariable(INode variable,
boolean normalize)
Remove the variable of the table. |
void |
restoreData()
Restores the data from the table using its stored copy. |
void |
setTableSize(int size)
|
void |
setValue(int[] coord,
float value)
Set a value in the table using the multidimensional coordinate, which is a list containing the state of each variable in the table. |
void |
setValue(int index,
float value)
Set a value in the table using the linear coordinate, which corresponds to the state of each variable in the table. |
void |
setVariableAt(int index,
INode node)
Inserts a variable into position |
protected void |
sum(int index)
|
int |
tableSize()
|
int |
variableCount()
Obtains the number of associated variables. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PRODUCT_OPERATOR
public static final int DIVISION_OPERATOR
public static final int PLUS_OPERATOR
public static final int MINUS_OPERATOR
protected List<Node> variableList
protected FloatCollection dataPT
protected FloatCollection dataCopy
protected FloatCollection dataMarginal
protected int[] factorsPT
protected int[] factorsMarginal
| Constructor Detail |
|---|
public PotentialTable()
| Method Detail |
|---|
public void copyData()
public void restoreData()
public void notifyModification()
IProbabilityFunction
notifyModification in interface IProbabilityFunctionpublic List<Node> cloneVariables()
public final int indexOfVariable(Node node)
public final int indexOfVariable(String nodeName)
public int variableCount()
IProbabilityFunction
variableCount in interface IProbabilityFunction
public void setVariableAt(int index,
INode node)
IProbabilityFunction
setVariableAt in interface IProbabilityFunctionindex - : position to insert variablenode - : variable to be insertedpublic INode getVariableAt(int index)
IProbabilityFunction
getVariableAt in interface IProbabilityFunctionpublic final int getVariableIndex(Node variable)
public void addValueAt(int index,
float value)
public final void removeValueAt(int index)
public int tableSize()
public void setTableSize(int size)
public Object clone()
clone in class Objectpublic Object clone(ProbabilisticNode newNode)
public void setValue(int[] coord,
float value)
coord - The multidimensional coordinate, which is a list containing
the state of each variable in the table.value - The value to be set in the table.
public final void setValue(int index,
float value)
index - The linear coordinate, which corresponds to the state
of each variable in the table.value - The value to be set in the table.public final float getValue(int index)
index - ÔøΩndice linear do valor na tabela a ser retornado.
public final float getValue(int[] coordenadas)
coordenadas - coordenadas do valor a ser pego.
public void addVariable(INode variavel)
IProbabilityFunction
addVariable in interface IProbabilityFunctionvariavel - : variable to be injected.
public void moveVariableWithoutMoveData(int initialPosition,
int destinationPosition)
initialPosition - destinationPosition - public int getVariablesSize()
public abstract void removeVariable(INode variable,
boolean normalize)
removeVariable in interface IProbabilityFunctionvariable - Variable to be removednormalize - True if is to normalize the cpt after the node remotionpublic abstract void removeVariable(INode variable)
IProbabilityFunction
removeVariable in interface IProbabilityFunctionvariable - variable to be removed.public abstract PotentialTable newInstance()
protected void sum(int index)
protected void finding(int control,
int index,
int[] coord,
int state)
public final int getLinearCoord(int[] multidimensionalCoord)
multidimensionalCoord - Multidimensional coordinate (represented by the state for
each node).
protected void computeFactors()
public final int[] getMultidimensionalCoord(int linearCoord)
linearCoord - The linear coordinate.
public final int getLinearCoordMarginal(int[] multidimensionalCoord)
multidimensionalCoord - Multidimensional coordinate (represented by the state for
each node).
protected void computeFactorsMarginal()
public final int[] getMultidimensionalCoordMarginal(int linearCoord)
linearCoord - The linear coordinate.
public final void directOpTab(PotentialTable tab,
int operator)
tab - table to operate.operator - operator to use, defined in this class constants.
public final void opTab(PotentialTable tab,
int operator)
tab - tabela a ser operada com esta.operator - operador a ser utilizado, definido pelas constantes desta
classe.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||