Package com.bayesserver
Class VariableMap
- java.lang.Object
-
- com.bayesserver.VariableMap
-
public final class VariableMap extends Object
Maps between a custom variable order and the default sorted variable order.- See Also:
Distribution.getSortedVariables()
-
-
Constructor Summary
Constructors Constructor Description VariableMap(VariableContextCollection sortedVariables, Node[] order)Initializes a new instance of theVariableMapclass.VariableMap(VariableContextCollection sortedVariables, List<Variable> order, List<Integer> times)Initializes a new instance of theVariableMapclass.VariableMap(VariableContextCollection sortedVariables, List<VariableContext> order)Initializes a new instance of theVariableMapclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intget(int orderIndex)Maps between the custom order and the sorted collection.
-
-
-
Constructor Detail
-
VariableMap
public VariableMap(VariableContextCollection sortedVariables, List<VariableContext> order)
Initializes a new instance of theVariableMapclass.- Parameters:
sortedVariables- The sorted variables.order- The custom order defined using variable contexts.- Throws:
NullPointerException- Raised if [sortedVariables] or [order] is null.IllegalArgumentException- Raised if the elements in [order] are not found in [sortedVariables].
-
VariableMap
public VariableMap(VariableContextCollection sortedVariables, List<Variable> order, List<Integer> times)
Initializes a new instance of theVariableMapclass.- Parameters:
sortedVariables- The sorted variables.order- The custom order.times- The times associated with the variables in [order]. Each entry can be null.- Throws:
NullPointerException- Raised if [sortedVariables] or [order] is null.IllegalArgumentException- Raised if the elements in [order] are not found in [sortedVariables].
-
VariableMap
public VariableMap(VariableContextCollection sortedVariables, Node[] order)
Initializes a new instance of theVariableMapclass.- Parameters:
sortedVariables- The sorted variables.order- The custom order, specified by nodes without times. If each node does not contain a single variable, use a different constructor.- Throws:
NullPointerException- Raised if [sortedVariables] or [order] is null.IllegalArgumentException- Raised if the elements in [order] are not found in [sortedVariables].
-
-