org.encog.ml.bayesian.table
Class BayesianTable
- java.lang.Object
-
- org.encog.ml.bayesian.table.BayesianTable
-
- All Implemented Interfaces:
- java.io.Serializable
public class BayesianTable extends java.lang.Object implements java.io.SerializableHolds a Bayesian truth table.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BayesianTable(BayesianEvent theEvent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddLine(double prob, boolean result, boolean... args)Add a new line.voidaddLine(double prob, int result, boolean... args)Add a new line.voidaddLine(double prob, int result, int... args)Add a new line.TableLinefindLine(int result, int[] args)Find the specified truth table line.intgenerateRandom(int... args)Generate a random sampling based on this truth table.java.util.List<TableLine>getLines()intgetMaxLines()voidreset()Reset the truth table to zero.java.lang.StringtoString()voidvalidate()Validate the truth table.
-
-
-
Constructor Detail
-
BayesianTable
public BayesianTable(BayesianEvent theEvent)
-
-
Method Detail
-
reset
public void reset()
Reset the truth table to zero.
-
addLine
public void addLine(double prob, boolean result, boolean... args)Add a new line.- Parameters:
prob- The probability.result- The resulting probability.args- The arguments.
-
addLine
public void addLine(double prob, int result, boolean... args)Add a new line.- Parameters:
prob- The probability.result- The resulting probability.args- The arguments.
-
addLine
public void addLine(double prob, int result, int... args)Add a new line.- Parameters:
prob- The probability.result- The resulting probability.args- The arguments.
-
validate
public void validate()
Validate the truth table.
-
generateRandom
public int generateRandom(int... args)
Generate a random sampling based on this truth table.- Parameters:
args- The arguemtns.- Returns:
- The result.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getLines
public java.util.List<TableLine> getLines()
- Returns:
- The lines of this truth table.
-
findLine
public TableLine findLine(int result, int[] args)
Find the specified truth table line.- Parameters:
result- The result sought.args- The arguments.- Returns:
- The line that matches.
-
getMaxLines
public int getMaxLines()
- Returns:
- The maximum number of lines this truth table would have.
-
-
DMelt 3.0 © DataMelt by jWork.ORG