Initializes a new instance of the {@link com.bayesserver.Variable} class, with {@link com.bayesserver.VariableValueType} discrete and zero states.
Initializes a new instance of the {@link com.bayesserver.Variable} class, with {@link com.bayesserver.VariableValueType} discrete, zero states, and the specified name.
The name of the variable. Can be null.
Initializes a new instance of the {@link com.bayesserver.Variable} class with the specified name, kind and value type. If discrete, no states are added.
The name of the variable. Can be null.
The value type, e.g. continuous or discrete.
The kind of Variable, e.g. Probability, Decision or Utility.
Initializes a new instance of the {@link com.bayesserver.Variable} class with the specified name and value type. If discrete, no states are added.
The name of the variable. Can be null.
The value type, e.g. continuous or discrete.
Initializes a new instance of the {@link com.bayesserver.Variable} class, with {@link com.bayesserver.VariableValueType} discrete and the specified [name] and adds the number of states specified in [states].
The name of the variable. Can be null.
The number of states to add to the Variable. States will be given default names.
Initializes a new instance of the {@link com.bayesserver.Variable} class, with {@link com.bayesserver.VariableValueType} discrete and the specified name and adds the states specified in [states].
The name of the variable. Can be null.
The number of states to add to the Variable. States will be given default names.
Initializes a new instance of the {@link com.bayesserver.Variable} class, with {@link com.bayesserver.VariableValueType} discrete and the specified name and adds the states specified in [states].
The name of the variable. Can be null.
The number of states to add to the Variable. States will be given default names.
Gets custom properties associated with this instance.
Custom properties allow storage of custom information, which will be saved with the network.
An optional description for the variable.
An optional description for the variable.
The Index of this instance in the collection of variables belonging to a network, or -1 if the variable does not belong to a node and hence a network.
Gets the kind of variable, such as Probability, Decision or Utility.
Gets the name of the variable.
When a variable is added to a network, its name must be unique. Comparisons are case sensitive.
Sets the name of the variable.
When a variable is added to a network, its name must be unique. Comparisons are case sensitive.
Gets the {@link com.bayesserver.Node} this instance belongs to, if any.
The node the instance belongs to, if any.
Gets the type of value that states belonging to this variable can represent. For example an interval.
Sets the type of value that states belonging to this variable can represent. For example an interval.
Returns the collection of states belonging to the variable.
Continuous variables always have a single state.
Gets the variable's value type, e.g. continuous or discrete.
The variable's value type.
Copies this instance.
A new {@link com.bayesserver.Variable} instance.
Finds a state based on a state value. E.g. finds the state who's interval contains the supplied value, or who's integer state value matches the supplied integer.
The value to test against state values. Type will depend on StateValueType. e.g. pass a double if the state value type is a double interval.
The matching state or null.
Returns the name of the variable, or an empty string if the name is null.
A {@link String} containing the name of the variable which is empty if the name is null.
Represents a discrete or continuous random variable.
Note that variable names must be unique per network, and are case sensitive.
A {@link com.bayesserver.Node Node} in a Bayesian network can contain one or more variables.
Although a discrete variable can contain a different number of {@link com.bayesserver.State states}, a continuous variable always contains a single state.