public class MDDVariable extends Object
A variable has a name, an optional associated object and set of possible values. For the sake of simplicity, only the number of possible values is defined, the MDD manager will use the integer range [0..nbval[.
A Boolean variable uses 2 values and will be mapped to the [0,1] interval.
A ternary variable uses 3 values and will be mapped to the [0,2] interval.
If your variable can take another set of values, it is your responsibility to map them to the [0..nbval[ interval.
| Modifier and Type | Field and Description |
|---|---|
Object |
key
Key used to create the variable.
|
byte |
nbval
Number of possible values for this variable.
|
int |
order
Rank of this variable in the MDDmanager.
|
| Constructor and Description |
|---|
MDDVariable(MDDStore store,
int order,
Object key,
byte nbval) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
after(MDDVariable other)
Test if this variable comes after another variable.
|
boolean |
equals(Object other) |
int |
getNode(int[] children)
Get a multi-valued node.
|
int |
getNode(int f,
int t)
get a boolean node.
|
int |
getNodeForValue(int v,
int value) |
int |
getNodeFree(int[] children)
Get a node and release the provided children.
|
int |
getNodeFree(int f,
int t)
Get a Boolean node and release the provided children.
|
int |
getSimpleNode(int vfalse,
int vtrue,
int start,
int end)
Get a node for the specified variable with two different children:
a "true" child in the specified range and a "false" one outside.
|
int |
hashCode() |
static MDDVariable |
selectFirstVariable(MDDVariable v1,
MDDVariable v2)
Get the variable with the best priority.
|
String |
toString() |
public final Object key
public final byte nbval
public final int order
public int getNodeForValue(int v,
int value)
public int getNode(int f,
int t)
f - left child (false)t - right child (true)public int getNode(int[] children)
children - public int getNodeFree(int f,
int t)
f - t - getNode(int, int)public int getNodeFree(int[] children)
children - getNode(int[])public int getSimpleNode(int vfalse,
int vtrue,
int start,
int end)
vfalse - the "false" childvtrue - the "true" childstart - the start of the "true" rangeend - the end of the "true" rangepublic boolean after(MDDVariable other)
other - public static MDDVariable selectFirstVariable(MDDVariable v1, MDDVariable v2)
v1 - v2 - Copyright © 2009–2020. All rights reserved.