Model

public class Model

A Model is a compact description of a table. A model consists of a list of discrete nodes and a set of expressions (one expression per configuration of states of the nodes.

  • Is this Model object alive?

    Declaration

    Swift

    public func isAlive() -> Bool
  • Constructs a Model for a Node given a list of Nodes.

    Declaration

    Swift

    public convenience init (_ belongsTo: Node, _ modelNodes: [Node] = [])
    throws
  • Deletes this Model.

    Declaration

    Swift

    public func delete() throws
  • Returns a array of nodes containing the Nodes in this Model.

    Declaration

    Swift

    public func getNodes() throws -> [Node]
  • Returns the number of configurations of the Nodes of this Model.

    Declaration

    Swift

    public func getSize() throws -> Int
  • Sets the number of values taken within each bounded interval of an interval parent when generating the conditional probability table for a node with interval parents.

    When generating the conditional probability table for a node with interval nodes as parents, a number of values are taken within each bounded interval of an interval parent. By default, the interval is divided into 25 subintervals, and the midpoints of these subintervals are then used in the computation of the value of the child.

    Declaration

    Swift

    public func setNumberOfSamplesPerInterval (_ count: Int)
    throws

    Parameters

    count

    the number of subintervals.

  • Returns the number of values per interval used when generating the conditional probability table for a node with interval parents.

    Declaration

    Swift

    public func getNumberOfSamplesPerInterval() throws -> Int

    Return Value

    An integer.

  • Associates an expression (specified as a String) with a specific configuration of the nodes of this Model.

    Declaration

    Swift

    public func setExpression (_ index: Int, _ expression: String?)
    throws

    Parameters

    index

    index of the state configuration of the nodes of the model.

    expression

    a textual representation of the expression to set for the specified configuration; nil means that the existing expression will be deleted.

  • Returns the expression (as a String) associated with a specific configuration of the nodes of this Model.

    Declaration

    Swift

    public func getExpressionAsString(_ index: Int) throws -> String?

    Parameters

    index

    index of the state configuration of the nodes of the model.

    Return Value

    a textual representation of the expression stored at the specified configuration; nil means that no expression has been stored at the specified configuration.