org.encog.ml.bayesian.table

## Class BayesianTable

- java.lang.Object
- - org.encog.ml.bayesian.table.BayesianTable

- All Implemented Interfaces:
    Serializable

      public class BayesianTable
      extends Object
      implements Serializable

  Holds a Bayesian truth table.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BayesianTable(BayesianEvent theEvent)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addLine(double prob, boolean result, boolean... args)` Add a new line.
    `void` | `addLine(double prob, int result, boolean... args)` Add a new line.
    `void` | `addLine(double prob, int result, int... args)` Add a new line.
    `TableLine` | `findLine(int result, int[] args)` Find the specified truth table line.
    `int` | `generateRandom(int... args)` Generate a random sampling based on this truth table.
    `List<TableLine>` | `getLines()`
    `int` | `getMaxLines()`
    `void` | `reset()` Reset the truth table to zero.
    `String` | `toString()`
    `void` | `validate()` Validate the truth table.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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 String toString()

      Overrides:
        `toString` in class `Object`

    - #### getLines

          public 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.

Copyright © 2014. All Rights Reserved.