Class

public class Class : Network

Instances of the Class class represent object-oriented Bayesian networks and LIMIDs. Such an instance can contain nodes representing instances of other network classes and so on. To use an instance (i.e., propagate evidence and calculate updated beliefs and expected utilities), it must first be unfolded to a plain Bayesian network or LIMID. The Domain.init(Class) and Domain.init(Class,Int) methods handle this.

  • Constructs a new Class in a ClassCollection.

    Declaration

    Swift

    public init(_ cc: ClassCollection) throws

    Parameters

    cc

    the ClassCollection in which to add the new Class.

  • Delete this Class, including all objects (such as Node objects) belonging to it. Deletion causes all these objects to be not-alive.

    Declaration

    Swift

    public func delete() throws
  • Is this Class object alive? This checks whether the class has been deleted.

    Declaration

    Swift

    override public func isAlive() -> Bool
  • Returns the ClassCollection to which this Class belongs.

    Declaration

    Swift

    public func getClassCollection() throws -> ClassCollection
  • Sets the name of this Class.

    Declaration

    Swift

    public func setName(_ name: String) throws

    Parameters

    name

    the name of this Class.

  • Returns the name of this Class. If this class has not previously been assigned a name, a valid name will automatically be assigned.

    Declaration

    Swift

    public func getName() throws -> String
  • Returns a list of the input nodes defined for this Class.

    Declaration

    Swift

    public func getInputs() throws -> [Node]

    Return Value

    NodeList containing the input nodes of this Class.

  • Returns a list of the output nodes defined for this Class.

    Declaration

    Swift

    public func getOutputs() throws -> [Node]

    Return Value

    NodeList containing the output nodes of this Class.

  • Constructs a node representing an instance of the specified Class. The node is added to this Class.

    Declaration

    Swift

    public func newInstance(_ instanceOf: Class) throws -> Node

    Parameters

    instanceOf

    the Class to be instantiated

  • Returns the list of InstanceNodes that are instances of this Class.

    Declaration

    Swift

    public func getInstances() throws -> [Node]

    Return Value

    a NodeList of InstanceNodes.