public class MDD extends Object
K.C. Cheng and R.H. Yap, "Maintaining generalized arc consistency on ad-hoc n-ary constraints.", CP 2008.
Modifier and Type | Field and Description |
---|---|
int[] |
diagram
For each node at given index i-th it specifies all possible
outgoing edges.
|
int[] |
domainLimits
The initial domain limits used to create an MDD array representation.
|
int |
freePosition
It specifies the first position in the array which is available for use.
|
static int |
NOEDGE
It specifies an identifier which denotes lack of the edge
for a given value (in the context of the current level (variable)
of an MDD.
|
static int |
START_SIZE
The initial size of the array representing an MDD.
|
static int |
TERMINAL
It specifies an identifier which denotes a terminal node.
|
IntVar[] |
vars
The ordered list of variables participating in MDD.
|
IndexDomainView[] |
views
It creates index domain views so operations based on indexes of values can
be performed efficiently.
|
Modifier | Constructor and Description |
---|---|
protected |
MDD() |
|
MDD(IntVar[] vars)
It creates and MDD representation given the list of variables.
|
|
MDD(IntVar[] vars,
int[][] table)
It creates and MDD representation given the list of variables
and (dis)allowed tuples.
|
|
MDD(IntVar[] vars,
int[] diagram,
int[] domainLimits)
It creates an MDD.
|
|
MDD(IntVar[] vars,
int[] minimumDomainLimits,
int[][] table)
It creates and MDD representation given the list of variables
and (dis)allowed tuples.
|
Modifier and Type | Method and Description |
---|---|
void |
addTuple(int[] tuple)
It allows to add one by one tuple before the reduction of the initial MDD takes place.
|
boolean |
checkIfAllowed() |
boolean |
checkIfAllowed(int[] tuple)
It checks if the specified tuple is allowed.
|
void |
ensureSize(int size)
It makes sure that diagram uses an array of at least given size.
|
int |
findPosition(int value,
int[] values)
It finds a position of a value inside the array.
|
protected int |
findRange(int value,
int[] values) |
void |
reduce()
It reduces MDD to minimal size.
|
MDD |
reuse(IntVar[] vars)
If possible it will return an MDD which reuse an array representation
of the current MDD.
|
String |
toString() |
public static final int TERMINAL
public static final int NOEDGE
public IntVar[] vars
public int[] domainLimits
public int[] diagram
public IndexDomainView[] views
public int freePosition
public static final int START_SIZE
public MDD(IntVar[] vars, int[] diagram, int[] domainLimits)
vars
- variables involved in this multiple-value decision diagram.diagram
- an int array representation of the diagram.domainLimits
- the limits on the number of values imposed on each variable.public MDD(IntVar[] vars, int[] minimumDomainLimits, int[][] table)
vars
- variables and their order used in the MDD.minimumDomainLimits
- it specifies the minimal number of values used for each of the variables.table
- it specifies the allowed tuples which are being converted into an MDD.public MDD(IntVar[] vars, int[][] table)
vars
- variables and their order used in the MDD.table
- it specifies the allowed tuples which are being converted into an MDD.public MDD(IntVar[] vars)
vars
- variables and their order used in the MDD.protected MDD()
public MDD reuse(IntVar[] vars)
vars
- array of new variables for which this MDD is being reused for.public void addTuple(int[] tuple)
tuple
- an allowed tuple being added to MDD.public void ensureSize(int size)
size
- the size the array must be at least of.public int findPosition(int value, int[] values)
value
- the value being searched.values
- the array in which the value is being searched for.protected int findRange(int value, int[] values)
public void reduce()
public boolean checkIfAllowed(int[] tuple)
tuple
- the tuple being checked.public boolean checkIfAllowed()
Copyright © 2022. All rights reserved.