Package org.jreliability.bdd.javabdd
Class JBDDProvider<T>
- java.lang.Object
-
- org.jreliability.bdd.javabdd.JBDDProvider<T>
-
- Type Parameters:
T
- the type of the variables
- All Implemented Interfaces:
BDDProvider<T>
public class JBDDProvider<T> extends java.lang.Object implements BDDProvider<T>
TheJBDDProvider
used to getJBDD
BDDs.
-
-
Field Summary
Fields Modifier and Type Field Description protected net.sf.javabdd.BDDFactory
factory
The usedBDDFactory
.protected java.util.Map<java.lang.Integer,T>
intToVariable
A translation of theInteger
in the realBDD
to the variable.protected int
variableGrowthFactor
The factor to extend the number of variables in case more variables are required.protected int
variableOffset
The offset of the variables.protected java.util.Map<T,java.lang.Integer>
variableToInt
A translation of the variable to anInteger
for the realBDD
.protected int
vars
The number of variables.
-
Constructor Summary
Constructors Constructor Description JBDDProvider(JBDDProviderFactory.Type type, int vars)
Constructs aJBDDProvider
with theJBDDProviderFactory.Type
of the BDD library to use and a given number of variables.JBDDProvider(JBDDProviderFactory.Type type, int vars, int variableGrowthFactor, int initialNumberofNodes)
Constructs aJBDDProvider
with theJBDDProviderFactory.Type
of the BDD library to use, a given number of variables, the growth rate of the number of variables, and the initial number of nodes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(java.util.List<T> variables)
Register variables in the specified order.void
add(T... variables)
Register variables in the specified order.T
get(BDD<T> bdd)
Returns thevariable
that is represented by theBDD
.BDD<T>
get(T variable)
Returns theBDD
that represents thevariable
.net.sf.javabdd.BDDFactory
getFactory()
Returns the usedBDDFactory
.BDD<T>
one()
Returns thetrue
or1
BDD.BDD<T>
zero()
Returns thefalse
or0
BDD.
-
-
-
Field Detail
-
variableOffset
protected int variableOffset
The offset of the variables.
-
factory
protected net.sf.javabdd.BDDFactory factory
The usedBDDFactory
.
-
variableToInt
protected java.util.Map<T,java.lang.Integer> variableToInt
A translation of the variable to anInteger
for the realBDD
.
-
intToVariable
protected java.util.Map<java.lang.Integer,T> intToVariable
A translation of theInteger
in the realBDD
to the variable.
-
vars
protected int vars
The number of variables.
-
variableGrowthFactor
protected int variableGrowthFactor
The factor to extend the number of variables in case more variables are required.
-
-
Constructor Detail
-
JBDDProvider
public JBDDProvider(JBDDProviderFactory.Type type, int vars)
Constructs aJBDDProvider
with theJBDDProviderFactory.Type
of the BDD library to use and a given number of variables.- Parameters:
type
- the type of the real bdd implementationvars
- the number of variables
-
JBDDProvider
public JBDDProvider(JBDDProviderFactory.Type type, int vars, int variableGrowthFactor, int initialNumberofNodes)
Constructs aJBDDProvider
with theJBDDProviderFactory.Type
of the BDD library to use, a given number of variables, the growth rate of the number of variables, and the initial number of nodes.- Parameters:
type
- the type of the BDD libraryvars
- the number of variablesvariableGrowthFactor
- the factor by which to extend the number of variables if requiredinitialNumberofNodes
- the initial number of nodes reserved in the BDD factory
-
-
Method Detail
-
add
public void add(java.util.List<T> variables)
Description copied from interface:BDDProvider
Register variables in the specified order.- Specified by:
add
in interfaceBDDProvider<T>
- Parameters:
variables
- the variables to register
-
add
public void add(T... variables)
Description copied from interface:BDDProvider
Register variables in the specified order.- Specified by:
add
in interfaceBDDProvider<T>
- Parameters:
variables
- the variables to register
-
zero
public BDD<T> zero()
Description copied from interface:BDDProvider
Returns thefalse
or0
BDD.- Specified by:
zero
in interfaceBDDProvider<T>
- Returns:
- the false or 0 BDD
-
one
public BDD<T> one()
Description copied from interface:BDDProvider
Returns thetrue
or1
BDD.- Specified by:
one
in interfaceBDDProvider<T>
- Returns:
- the true or 1 BDD
-
get
public BDD<T> get(T variable)
Description copied from interface:BDDProvider
Returns theBDD
that represents thevariable
.- Specified by:
get
in interfaceBDDProvider<T>
- Parameters:
variable
- the variable- Returns:
- the BDD that represents the Object
-
get
public T get(BDD<T> bdd)
Description copied from interface:BDDProvider
Returns thevariable
that is represented by theBDD
.- Specified by:
get
in interfaceBDDProvider<T>
- Parameters:
bdd
- the bdd- Returns:
- the variable represented by the BDD
-
getFactory
public net.sf.javabdd.BDDFactory getFactory()
Returns the usedBDDFactory
.- Returns:
- the used bdd factory
-
-