Package org.jreliability.bdd
Class BDDTopEvent<T>
- java.lang.Object
-
- org.jreliability.bdd.BDDTopEvent<T>
-
- Type Parameters:
T
- the type of variables
public class BDDTopEvent<T> extends java.lang.Object
TheBDDTopEvent
allows the fast calculation of the top event for a givenBDD
.Here, the
BDD
is copied to an internal structure such that theBDD.free()
method does not interfere with this class.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<org.jreliability.bdd.BDDTopEvent.VarNode>
nodes
A list of all variables nodes (ordered from bottom to the root).protected org.jreliability.bdd.BDDTopEvent.Node
one
The instance of the one node.protected org.jreliability.bdd.BDDTopEvent.Node
root
The root of the bdd.protected java.util.Map<T,org.jreliability.bdd.BDDTopEvent.Var>
variables
Map of the original variables to the internal structure of the variables.protected org.jreliability.bdd.BDDTopEvent.Node
zero
The instance of the zero node.
-
Constructor Summary
Constructors Constructor Description BDDTopEvent(BDD<T> bdd)
Constructs theBDDTopEvent
calculator for a givenBDD
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.jreliability.bdd.BDDTopEvent.Node
build(BDD<T> bdd, java.util.Map<BDD<T>,org.jreliability.bdd.BDDTopEvent.VarNode> map)
Builds the internal node from aBDD
node.double
calculate(org.apache.commons.collections15.Transformer<T,java.lang.Double> transformer)
Calculates the top event for the values given by the functionTransformer.protected org.jreliability.bdd.BDDTopEvent.Var
getVariable(BDD<T> bdd)
Returns the internal variable for aBDD
.
-
-
-
Field Detail
-
variables
protected java.util.Map<T,org.jreliability.bdd.BDDTopEvent.Var> variables
Map of the original variables to the internal structure of the variables.
-
nodes
protected java.util.List<org.jreliability.bdd.BDDTopEvent.VarNode> nodes
A list of all variables nodes (ordered from bottom to the root).
-
zero
protected org.jreliability.bdd.BDDTopEvent.Node zero
The instance of the zero node.
-
one
protected org.jreliability.bdd.BDDTopEvent.Node one
The instance of the one node.
-
root
protected org.jreliability.bdd.BDDTopEvent.Node root
The root of the bdd.
-
-
Constructor Detail
-
BDDTopEvent
public BDDTopEvent(BDD<T> bdd)
Constructs theBDDTopEvent
calculator for a givenBDD
.- Parameters:
bdd
- the given BDD
-
-
Method Detail
-
calculate
public double calculate(org.apache.commons.collections15.Transformer<T,java.lang.Double> transformer)
Calculates the top event for the values given by the functionTransformer.- Parameters:
transformer
- the transformer from the variables to the values- Returns:
- the top event
-
getVariable
protected org.jreliability.bdd.BDDTopEvent.Var getVariable(BDD<T> bdd)
Returns the internal variable for aBDD
.- Parameters:
bdd
- the BDD- Returns:
- the corresponding internal variable
-
build
protected org.jreliability.bdd.BDDTopEvent.Node build(BDD<T> bdd, java.util.Map<BDD<T>,org.jreliability.bdd.BDDTopEvent.VarNode> map)
Builds the internal node from aBDD
node.- Parameters:
bdd
- the original BDD nodemap
- a map from the internal node to the BDD node- Returns:
- the internal node
-
-