Node
public class Node : Hashable
Nodes are one of the fundamental objects used in the construction
of Bayesian networks and LIMIDs. All nodes need a Network
(i.e., a Class or a Domain); that is, the network must exist
before its nodes can be created.
-
Undocumented
Declaration
Swift
public let category: Node.Category -
Undocumented
Declaration
Swift
public let kind: Node.Kind -
Declaration
Swift
public func hash(into hasher: inout Hasher) -
Is this
Nodeobject alive? This checks whether the node has been deleted.Declaration
Swift
public func isAlive() -> Bool -
The category of a node indicates whether the node is a chance node, a decison node, a utility node, a (real-valued or a discrete) function node, or a class instance node (representing an instance of a class in an OOBN).
See moreDeclaration
Swift
public enum Category -
This is used to distinguish between
See morediscrete,continuous, andothernodes.Declaration
Swift
public enum Kind -
This is used to distinguish between (sub)types of
See morediscretenodes. All discrete nodes can have labels associated with the states (not just nodes of subtypelabel).Declaration
Swift
public enum Subtype -
Delete this node, including all objects (such as Table objects) belonging to it. Deletion causes all these objects to be not-alive.
Declaration
Swift
public func delete() throws -
Declaration
Swift
public static func == (lhs: Node, rhs: Node) -> Bool -
Returns the Class or Domain containing this
Node.Declaration
Swift
public func getHome() throws -> NetworkReturn Value
The Network containing this
Node. -
Sets the subtype of this
Node.Requires
This only applies to discrete nodes.Declaration
Swift
public func setSubtype(_ subtype: Subtype) throws -
Returns the subtype of this
Node.Requires
This only applies to discrete nodes.Declaration
Swift
public func getSubtype() throws -> Subtype -
Sets the name of this
Node. The name must be valid, i.e., it must follow the rules that govern the validity of C identifiers, and no other node in the network to which thisNodebelongs must have the same name.Declaration
Swift
public func setName(_ newName: String) throwsParameters
newNamethe name of the
Node(a String). -
Returns the name of this
Node. If this node has not previously been assigned a name, a valid name will automatically be assigned.Declaration
Swift
public func getName() throws -> StringReturn Value
the name of this node.
-
Sets the label of this
Node.Declaration
Swift
public func setLabel(_ newLabel: String) throwsParameters
newLabelthe label (a String).
-
Returns the label of this
Node.Declaration
Swift
public func getLabel() throws -> String? -
Sets a value for a particular attribute in the attribute list for this
Node. If no value (nil) is provided, the attribute is removed.Declaration
Swift
public func setAttribute(_ key: String, _ value: String?) throwsParameters
keya String identifying the attribute in question.
valuea String containing the attribute value.
-
Returns the value associated with a particular attribute in the attribute list for this
Node.Declaration
Swift
public func getAttribute(_ key: String) throws -> String?Parameters
keya String identifying the attribute in question.
Return Value
A String containing the attribute value.
-
Returns the set of attributes (as a dictionary) associated with this
Node.Declaration
Swift
public func getAttributes() throws -> [String : String] -
Adds a node as a new parent of this
Node. That is, it adds a directed link from the new parent to thisNode.Declaration
Swift
public func addParent(_ parent: Node) throwsParameters
parentthe new parent
Node. -
Removes the directed link between a parent and this
Node. The table (if any) of theNodewill be updated such that the updated table will be the portion of the old table that corresponds to the parent being in its first state.Declaration
Swift
public func removeParent(_ parent: Node) throwsParameters
parentthe parent
Nodethat will be removed. -
Replace the given parent node with the new node. The old and new parent must be compatible. That is, they must be of the same class, and have an identical state set.
Declaration
Swift
public func switchParent(_ oldParent: Node, _ newParent: Node) throwsParameters
oldParentThe old parent
newParentThe new parent
-
Reverses the edge between this
Nodeand the specified neighbor. Both nodes must be chance nodes, and they must be of the same kind (that is, both nodes are discrete or both nodes are continuous).Declaration
Swift
public func reverseEdge(_ neighbor: Node) throwsParameters
neighborthe neighbor in question.
-
Returns a list of nodes containing the parents of this
Node.Declaration
Swift
public func getParents() throws -> [Node] -
Returns a node list with the child
Nodes of thisNode.Declaration
Swift
public func getChildren() throws -> [Node] -
Returns a list of nodes containing the requisite parents of this node.
Requires
This only applies to decision nodes in domains.Declaration
Swift
public func getRequisiteParents() throws -> [Node] -
Returns a list of nodes containing the requisite ancestors of this
Node.The requisite ancestors are found by augmenting the network with additional information links as prescribed by the “no-forgetting” rule (which states that past observations and decisions are taken into account by all future decisions) and applying the minimal reduction algorithm for LIMIDs.
Requires
This only applies to decision nodes in domains.Declaration
Swift
public func getRequisiteAncestors() throws -> [Node] -
Sets the number of states of this node.
Requires
This only applies to discrete nodes.Declaration
Swift
public func setNumberOfStates(_ stateCount: Int) throws -
Returns the number of states of this node. The states are numbered from 0 to N-1, where N is the number of states of the node.
Requires
This only applies to discrete nodes.Declaration
Swift
public func getNumberOfStates() throws -> Int -
Sets the label of the specified state.
Requires
This only applies to discrete nodes.
Declaration
Swift
public func setStateLabel(_ state: Int, _ newLabel: String) throwsParameters
statethe index (a nonnegative integer) of the state; must be less than the number of states of the node.
newLabelthe desired state label (a String).
-
Returns the label of the specified state.
Requires
This only applies to discrete nodes.
Declaration
Swift
public func getStateLabel(_ state: Int) throws -> StringParameters
statethe index (a nonnegative integer) of the state; must be less than the number of states of the node
Return Value
the label (a String) of the specified state
-
Returns the index of the state matching the specified label. If there is no (unique) state with the specified state label,
nilis returned.Requires
This only applies to discrete nodes.
Declaration
Swift
public func getStateIndex(label: String) throws -> Int?Parameters
labelthe state label to search for
Return Value
the index of the unique state having the specified state label.
-
Reorders the list of states of this node. The
orderlist must contain the state labels of this node in the desired order.In addition to reordering the state labels of this node, the contents of all tables and models containing this node, and case data associated with this node, are updated to match the new ordering of the states.
The states of this node must be uniquely labeled.
Requires
This only applies to discrete nodes.
Declaration
Swift
public func reorderStates(_ order: [String]) throwsParameters
orderthe new order (which must be a permutation of the current order) of the state labels of this node.
-
Sets the value associated with a particular state of this node.
Requires
This only applies to discrete nodes. The subtype of the node must be
numberorinterval.Declaration
Swift
public func setStateValue(_ state: Int, _ value: Double) throwsParameters
statethe index of the state in question.
valuethe new value for state
state. -
Returns the value associated with a particular state of this node.
Requires
This only applies to discrete nodes. The subtype of the node must be
numberorinterval.Declaration
Swift
public func getStateValue(_ state: Int) throws -> DoubleParameters
statethe index of the state in question.
-
Returns the quantile corresponding to the specified
probabilityargument of the inverse cumulative distribution function.Requires
This only applies to discrete nodes. The subtype of the node must benumberorinterval.Declaration
Swift
public func getQuantile(_ probability: Double) throws -> Double -
Returns the index of the state matching the specified value. If there is no (unique) state matching the specified state value,
nilis returned.Requires
This only applies to discrete nodes. The subtype of the node must be
numberorinterval.Declaration
Swift
public func getStateIndex(value: Double) throws -> Int?Parameters
valuethe value to match against the states of this node.
Return Value
the index of the state matching the specified
value. -
Returns the Model for this
Node.Declaration
Swift
public func getModel() throws -> Model? -
Generates the table of this
Nodefrom its model (a missing model will trigger aHuginError.usageerror).Declaration
Swift
public func generateTable() throws -
Returns the
JunctionTreeto which thisNodebelongs.Declaration
Swift
public func getJunctionTree() throws -> JunctionTree -
Returns the predicted belief for the specified state of this node at the specified time point. This method accesses the predictions computed by a previous call to
Domain.computeDBNPredictions(Int).Requires
This only applies to discrete nodes in DBN runtime domains.
Declaration
Swift
public func getPredictedBelief(_ state: Int, _ time: Int) throws -> DoubleParameters
statean integer value representing which state to examine.
timetime slice index (a nonnegative integer less than the number of predicted time slices)
Return Value
A real number representing the belief.
-
Returns the predicted mean of the marginal distribution of this node at the specified time point. This method accesses the predictions computed by a previous call to
Domain.computeDBNPredictions(Int).Requires
This only applies to continuous nodes in DBN runtime domains.
Declaration
Swift
public func getPredictedMean(_ time: Int) throws -> DoubleParameters
timetime slice index (a nonnegative integer less than the number of predicted time slices)
-
Returns the predicted variance of the marginal distribution of this node at the specified time point. This method accesses the predictions computed by a previous call to
Domain.computeDBNPredictions(Int).Requires
This only applies to continuous nodes in DBN runtime domains.
Declaration
Swift
public func getPredictedVariance(_ time: Int) throws -> DoubleParameters
timetime slice index (a nonnegative integer less than the number of predicted time slices)
-
Returns the predicted value of this node at the specified time point. This method accesses the predictions computed by a previous call to
Domain.computeDBNPredictions(Int).Requires
This only applies to real-valued function nodes in DBN runtime domains.
Declaration
Swift
public func getPredictedValue(_ time: Int) throws -> DoubleParameters
timetime slice index (a nonnegative integer less than the number of predicted time slices)
-
Specifies a finding value for a given state with all other states unaffected.
Requires
This only applies to discrete nodes in domains.
Declaration
Swift
public func enterFinding(_ state: Int, _ finding: Double) throwsParameters
statean integer representing the state to be selected. States are numbered consecutively from 0 and upwards.
findingA nonnegative real number as the finding value.
-
Returns the entered finding for the specified state of this node.
Requires
This only applies to discrete nodes in domains.
Declaration
Swift
public func getEnteredFinding(_ state: Int) throws -> DoubleParameters
statean integer value representing which state to examine.
Return Value
A real number representing the entered finding.
-
Returns the propagated finding. That is, it returns the finding value incorporated within the current junction tree potentials for the specified state of this node.
Requires
This only applies to discrete nodes in domains.
Declaration
Swift
public func getPropagatedFinding(_ state: Int) throws -> DoubleParameters
statean integer representing the state to be examined.
-
Retracts all evidence for this node.
Requires
This only applies to discrete/continuous nodes in domains.Declaration
Swift
public func retractFindings() throws -
Enters evidence (observation of a numeric value) for this
Node.Requires
This only applies to continuous nodes in domains.Declaration
Swift
public func enterValue(_ value: Double) throws -
Returns the evidence (value) entered for this
Node. If no value has been entered,nilis returned.Requires
This only applies to continuous nodes in domains.Declaration
Swift
public func getEnteredValue() throws -> Double? -
Retrieves the value that has been propagated for this
Node. That is, the value incorporated in the current junction tree potentials as the state of this node.Requires
This only applies to continuous nodes in domains.Declaration
Swift
public func getPropagatedValue() throws -> Double? -
Returns
trueif the evidence potential, currently registered with thisNode, is non-vacuous; otherwise, returnsfalse.Requires
This only applies to discrete/continuous nodes in domains.Declaration
Swift
public func evidenceIsEntered() throws -> Bool -
Returns
trueif the evidence potential, currently registered with thisNode, is a likelihood; otherwise, returnsfalse.Requires
This only applies to discrete/continuous nodes in domains.Declaration
Swift
public func likelihoodIsEntered() throws -> Bool -
Returns
trueif the evidence potential for thisNode, incorporated within the current junction tree potentials, is non-vacuous; otherwise, returnsfalse.Requires
This only applies to discrete/continuous nodes in domains.Declaration
Swift
public func evidenceIsPropagated() throws -> Bool -
Returns
trueif the evidence potential for thisNode, incorporated within the current junction tree potentials, a likelihood; otherwise, returnsfalse.Requires
This only applies to discrete/continuous nodes in domains.Declaration
Swift
public func likelihoodIsPropagated() throws -> Bool -
Returns the belief for the specified state of this DiscreteNode. Note that if findings have been entered since the most recent propagation, the beliefs returned may not be up-to-date.
Requires
This only applies to discrete nodes in domains.
Declaration
Swift
public func getBelief(_ state: Int) throws -> DoubleParameters
statean integer value representing which state to examine.
Return Value
A real number representing the belief.
-
Returns the mean of the marginal distribution of this node.
Requires
This only applies to continuous nodes in domains.Declaration
Swift
public func getMean() throws -> Double -
Returns the variance of the marginal distribution of this node.
Requires
This only applies to continuous nodes in domains.Declaration
Swift
public func getVariance() throws -> Double -
Returns the distribution for this node. The distribution for a continuous chance node is in general a mixture of several Gaussian distributions. This method computes a joint distribution of this CG node and a set of discrete nodes. These discrete nodes are chosen such that the computed marginal is a strong marginal, but it is not necessarily minimal.
Requires
This only applies to continuous nodes in domains.
Declaration
Swift
public func getDistribution() throws -> TableReturn Value
A
Tableholding a strong marginal of this node and a set of discrete nodes. -
If this node is a discrete node: Returns the expected utility associated with the specified action (state).
If this node is a utility node: Returns the expected utility associated with the node.
This is the utility value computed by the most recent inference operation.
Requires
This only applies to discrete nodes and utility nodes in domains.
Declaration
Swift
public func getExpectedUtility(state: Int = 0) throws -> DoubleParameters
stateAn integer value designating which state to examine.
-
Returns the variance of the utility associated with this node. This is the variance of the utility value computed by the most recent inference operation.
Requires
This only applies to utility nodes in domains.Declaration
Swift
public func getVarianceOfUtility() throws -> Double -
Returns the minimum possible utility associated with this node. This is the smallest utility value for this node with a positive probability as computed by the most recent inference operation.
Requires
This only applies to utility nodes in domains.Declaration
Swift
public func getMinUtility() throws -> Double -
Returns the maximum possible utility associated with this node. This is the largest utility value for this node with a positive probability as computed by the most recent inference operation.
Requires
This only applies to utility nodes in domains.Declaration
Swift
public func getMaxUtility() throws -> Double -
Returns the value of this node. The value is computed using the function associated with the node. If the function refers to other nodes, then the values of those nodes are derived from the results of the most recent inference operation.
Requires
This only applies to real-valued function nodes.Declaration
Swift
public func getValue() throws -> Double -
Returns the table associated with this
Node.If the node is a discrete chance node, the table is the conditional probability table for the node given its parents.
If the node is a utility node, the table represents a utility function of the parents of the node.
Declaration
Swift
public func getTable() throws -> Table -
Returns the experience table of this node.
Requires
This only applies to chance nodes.Declaration
Swift
public func getExperienceTable() throws -> Table -
Returns
trueif this node has an experience table; returnsfalseotherwise.Requires
This only applies to chance nodes.Declaration
Swift
public func hasExperienceTable() throws -> Bool -
Returns the fading table of this node.
Requires
This only applies to discrete chance nodes.Declaration
Swift
public func getFadingTable() throws -> Table -
Returns
trueif this node has a fading table; returnsfalseotherwise.Requires
This only applies to discrete chance nodes.Declaration
Swift
public func hasFadingTable() throws -> Bool -
Sets the alpha component of the CG distribution of this node given the discrete parent configuration corresponding to
index.Requires
This only applies to continuous chance nodes.
Declaration
Swift
public func setAlpha(_ index: Int, _ alpha: Double) throwsParameters
indexthe index of a discrete parent configuration.
alphathe value of the alpha component.
-
Sets the beta component of the CG distribution of this node given a continuous parent and the discrete parent configuration corresponding to
index.Requires
This only applies to continuous chance nodes.
Declaration
Swift
public func setBeta(_ index: Int, _ parent: Node, _ beta: Double) throwsParameters
indexthe index of a discrete parent configuration.
parenta continuous parent of this node.
betathe value of the beta component.
-
Sets the gamma component of the CG distribution of this node given the discrete parent configuration corresponding to
index.Requires
This only applies to continuous chance nodes.
Declaration
Swift
public func setGamma(_ index: Int, _ gamma: Double) throwsParameters
indexthe index of a discrete parent configuration.
gammathe value of the gamma component.
-
Returns the alpha component of the CG distribution of this node given the discrete parent configuration corresponding to
index.Requires
This only applies to continuous chance nodes.
Declaration
Swift
public func getAlpha(_ index: Int) throws -> DoubleParameters
indexthe index of a discrete parent configuration.
Return Value
the alpha component.
-
Returns the beta component of the CG distribution of this node given a continuous parent and the discrete parent configuration corresponding to
index.Requires
This only applies to continuous chance nodes.
Declaration
Swift
public func getBeta(_ index: Int, _ parent: Node) throws -> DoubleParameters
indexthe index of a discrete parent configuration.
parenta continuous parent of this node.
Return Value
the beta component.
-
Returns the gamma component of the CG distribution of this node given the discrete parent configuration corresponding to
index.Requires
This only applies to continuous chance nodes.
Declaration
Swift
public func getGamma(_ index: Int) throws -> DoubleParameters
indexthe index of a discrete parent configuration.
Return Value
the gamma component.
-
Selects the specified state of this node. This is equivalent to specifying the finding value 1 for the specified state and 0 for all other states.
Requires
This only applies to discrete nodes in domains.Declaration
Swift
public func selectState(_ state: Int) throws -
Returns a list of
Nodeobjects belonging to classes, if thisNodebelongs to a runtime domain. Otherwise,nilis returned.The
Domain.init(Class)initializer unfolds an OOBN (an object-oriented specification of a Bayesian network or a LIMID) into a regularDomainobject.Nodes in this domain which originates from nodes residing in nested sub-networks (via instance nodes) can be uniquely related to a sequence of instance nodes and an ordinary node of the OOBN.
Declaration
Swift
public func getSource() -> [Node]?Return Value
An ordered list of nodes containing the instance nodes and the ordinary node identifying the source of this
Node. -
Sets the state of this node for the specified case.
Requires
This only applies to discrete nodes.
Declaration
Swift
public func setCase(_ c: Int, state: Int) throwsParameters
cthe index of the case (an integer in the range 0, …, number of cases - 1)
statethe state of the specified case for this node
-
Returns the state of this node for the specified case. Returns
nilif no state has been set.Requires
This only applies to discrete nodes.
Declaration
Swift
public func getCaseState(_ c: Int) throws -> Int?Parameters
cthe index of the case (an integer in the range 0, …, number of cases - 1)
-
Sets the value of this node for the specified case.
Requires
This only applies to continuous nodes.
Declaration
Swift
public func setCase(_ c: Int, value: Double) throwsParameters
cthe index of the case (an integer in the range 0, …, number of cases - 1)
valuethe value of the specified case for this
Node -
Returns the value of this node for the specified case. Returns
nilif no value has been set.Requires
This only applies to continuous nodes.
Declaration
Swift
public func getCaseValue(_ c: Int) throws -> Double?Parameters
cthe index of the case (an integer in the range 0, …, number of cases - 1)
-
Specifies that the state or value of this node is “unknown” for the specified case.
Declaration
Swift
public func unsetCase(_ c: Int) throwsParameters
cthe index of the case (an integer in the range 0, …, number of cases - 1)
-
Returns
trueif a state or a value has been set for this node in the specified case; otherwise, returnsfalse.Declaration
Swift
public func caseIsSet(_ c: Int) throws -> BoolParameters
cthe index of the case (an integer in the range 0, …, number of cases - 1)
-
Sets an edge constraint between this node and another node. The constraint must be an instance of
Network.EdgeConstraint.Declaration
Swift
public func setEdgeConstraint (_ node: Node, _ constraint: Network.EdgeConstraint) throwsParameters
nodethe other node in the constraint.
constraintthe constraint to set.
-
Returns the edge constraint between this node and another node.
Declaration
Swift
public func getEdgeConstraint (_ node: Node) throws -> Network.EdgeConstraintParameters
nodethe other node in the constraint.
Return Value
The Network.EdgeConstraint set between the two nodes.
-
Returns
trueif the entered and the propagated evidence differ; otherwise, returnsfalse.Declaration
Swift
public func evidenceToPropagate() throws -> Bool -
Returns the state index of this node for the configuration generated by the most recent call to
Domain.simulate().Requires
This only applies to discrete nodes in domains.Declaration
Swift
public func getSampledState() throws -> Int -
Returns the value of this node for the configuration generated by the most recent call to
Domain.simulate().Requires
This only applies to continuous nodes and real-valued function nodes in domains.Declaration
Swift
public func getSampledValue() throws -> Double -
Returns the sampled utility associated with this node. This is the utility value determined by the most recent call to
Domain.simulate().Requires
This only applies to utility nodes in domains.Declaration
Swift
public func getSampledUtility() throws -> Double -
Computes the entropy of this node.
Requires
This only applies to discrete nodes in domains.Declaration
Swift
public func getEntropy() throws -> Double -
Computes the mutual information between this node and the specified node.
Requires
This only applies to discrete nodes in domains.
Declaration
Swift
public func getMutualInformation(_ node: Node) throws -> DoubleParameters
nodethe other node (must be discrete)
-
Computes the constants of the sensitivity functions for the specified output probability and all CPT/policy parameters in the network.
This method simply calls
Domain.computeSensitivityData([Node],[Int])with the specified output probability as argument.Declaration
Swift
public func computeSensitivityData(_ state: Int) throwsParameters
statethe index of a state of this node - the probability of this state is the desired output probability.
-
Returns the four constants of the specified sensitivity function. The output probability of this function was specified in the preceding call to
Node.computeSensitivityData(Int). If the results produced by that call have been invalidated, a usage error is thrown.Declaration
Swift
public func getSensitivityConstants (_ input: Int) throws -> (Double, Double, Double, Double)Parameters
inputspecifies a conditional probability (or policy) parameter of this node (i.e.,
inputis the index of an entry in the CPT/policy of this node).Return Value
a 4-tuple containing the constants of the specified sensitivity function.
-
Returns the four constants of the specified sensitivity function. The output probability of this function must be one of the output probabilities specified in the preceding call to
Domain.computeSensitivityData([Node],[Int]). If the results produced by that call have been invalidated, a usage error is thrown.Declaration
Swift
public func getSensitivityConstants (_ input: Int, _ output: Int) throws -> (Double, Double, Double, Double)Parameters
inputspecifies a conditional probability (or policy) parameter of this node (i.e.,
inputis the index of an entry in the CPT/policy of this node).outputidentifies one of the output probabilities specified in the call to
Domain.computeSensitivityData([Node],[Int]).Return Value
a 4-tuple containing the constants of the specified sensitivity function.
-
Computes Bayes factor data for all (nonempty) subsets of evidence nodes up to the specified maximum size. Two hypotheses are compared: (this node)=x and Y=y. For each subset of evidence nodes (up to the specified maximum size), the Bayes factor (the support for the first hypothesis relative to the second hypothesis) is computed. The results of the computations can be accessed using
Domain.getExplanation(Int)andDomain.getExplanationScore(Int).Declaration
Swift
public func computeExplanationData (_ x: Int, _ Y: Node, _ y: Int, _ maxSubsetSize: Int) throwsParameters
xstate of the primary hypothesis node (this node)
Ythe alternative hypothesis node (must be discrete)
ystate of the alternative hypothesis node
maxSubsetSizedata for all subsets of evidence nodes up to this size are computed
-
Computes “normalized likelihoods” for the specified hypothesis and all (nonempty) subsets of evidence nodes up to the specified maximum size. For each subset of evidence nodes (up to the specified maximum size), the normalized likelihood of the hypothesis is computed. The results of the computations can be accessed using
Domain.getExplanation(Int)andDomain.getExplanationScore(Int).Declaration
Swift
public func computeExplanationData (_ state: Int, _ maxSubsetSize: Int) throwsParameters
statestate of the hypothesis node (this node)
maxSubsetSizedata for all subsets of evidence nodes up to this size are computed
-
Makes this
Nodebecome an input node of its class.Requires
This only applies to nodes in classes.Declaration
Swift
public func addToInputs() throws -
Removes this
Nodefrom the set of input nodes of its class.Declaration
Swift
public func removeFromInputs() throws -
Makes this
Nodebecome an output node of its class.Requires
This only applies to nodes in classes.Declaration
Swift
public func addToOutputs() throws -
Removes this
Nodefrom the set of output nodes of its class.Declaration
Swift
public func removeFromOutputs() throws -
Returns the instance class of this instance node (i.e., the class on which this instance node is based).
Requires
This method only applies to instance nodes.Declaration
Swift
public func getInstanceClass() throws -> Class -
Returns the “master” of this output clone.
An “instance node” represents an instance of some
Classin an OOBN. This class has a set of output nodes. When an instance of a class is created, clones of the output nodes of the instantiated class are created and associated with the instance node. The output nodes of the instantiated class are referred to as “masters” of the output clones.Declaration
Swift
public func getMaster() throws -> Node?Return Value
The “master” of this
Nodeif it is an output clone; otherwise, the method returnsnil. -
Returns the “instance node” associated with this output clone.
An “instance node” represents an instance of some
Classin an OOBN. This class has a set of output nodes. When an instance of a class is created, clones of the output nodes of the instantiated class are created and associated with the instance node.Declaration
Swift
public func getInstance() throws -> Node?Return Value
The “instance node” associated with this output clone. If this node is not an output clone,
nilis returned. -
Returns the output clone associated with this instance node for the given output node (belonging to the class represented by this instance node).
Requires
This method only applies to instance nodes.
Declaration
Swift
public func getOutput(_ output: Node) throws -> NodeParameters
outputan output node in the class that this node is an instance of.
Return Value
the output clone corresponding to
outputfor this instance node. -
Constructs a temporal clone of this
Nodeobject. This node (known as the “master” node) must not be an instance node, or a temporal or an output clone, and the node must belong to a class without input and output nodes. Moreover, this class must not be instantiated. Only one temporal clone can be created for each master node.Declaration
Swift
public func createTemporalClone() throws -> Node -
Returns the “temporal clone” of this
Node. If this node doesn’t have a temporal clone,nilis returned.Declaration
Swift
public func getTemporalClone() throws -> Node? -
Returns the “temporal master” of this
Node. If this node is not a temporal clone,nilis returned.Declaration
Swift
public func getTemporalMaster() throws -> Node? -
Sets the position of this
Node.Declaration
Swift
public func setPosition(_ x: Int, _ y: Int) throws -
Returns the position of this
Node.Declaration
Swift
public func getPosition() throws -> (Int, Int)Return Value
The coordinates of the node as a pair of integers
Node Class Reference