Package org.jreliability.bdd
Class BDDs
java.lang.Object
org.jreliability.bdd.BDDs
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected static <T> BDD<T> buildConstraintBDD(List<org.jreliability.bdd.BDDConstraint.Literal<T>> literals, int rhs, int index, int sum, int materialLeft, Map<org.jreliability.bdd.BDDConstraint.Pair<Integer, Integer>, BDD<T>> memo, BDDProvider<T> provider) Returns a greater-equal constraint represented as aBDDvia a recursive procedure proposed by Een & Soerrensson 2006.static <T> doublecalculateTop(BDD<T> bdd, org.apache.commons.collections15.Transformer<T, Double> transformer) Calculates the top event of theBDDbased on a functionTransformer that delivers for each variableTa double value.protected static <T> voidcollectDotEdges(BDD<T> bdd, StringBuffer dot, Map<BDD<T>, String> variables, Set<BDD<T>> considered) Traverses theBDDto collects all edges for the DOT representation.protected static <T> voidcollectDotMarkers(BDD<T> bdd, StringBuffer dot, Map<T, String> markers) Traverses theBDDto setup the correct ranks of all nodes belonging to the same variable.protected static <T> voidcollectDotNodes(BDD<T> bdd, StringBuffer dot, Map<BDD<T>, String> variables, Map<T, Integer> counters) Traverses theBDDto collects all nodes for the DOT representation.protected static <T> voidcollectDotRanks(BDD<T> bdd, StringBuffer dot, Map<BDD<T>, String> variables, Map<T, String> markers) Traverses theBDDto setup the correct ranks of all nodes belonging to the same variable.protected static <T> voidTraverses theBDDto collect all nodes for a given variableT.protected static <T> voidcollectVariables(BDD<T> bdd, Set<T> variables, Set<BDD<T>> considered) Traverses theBDDto collect all variables.protected static <T> voidcollectVariablesSorted(BDD<T> bdd, List<T> variables) protected static <T> doubleevaluate(BDD<T> bdd, org.apache.commons.collections15.Transformer<T, Double> transformer, Set<BDD<T>> upSort) Evaluates the BDD to determine the top event.static <T> BDD<T> getBDD(List<Integer> coeffs, List<BDD<T>> vars, LinearTerm.Comparator comp, int rhs, BDDProvider<T> provider) Converts a linear constraint to aBDD.protected static <T> BDD<T> getConstraintBDD(org.jreliability.bdd.BDDConstraint<T> constraint, BDDProvider<T> provider) Returns a greater-equal constraint represented as aBDD.Returns all nodes of theBDDthat represent the variableT.static <T> Set<T> getVariables(BDD<T> bdd) Returns all variables (elements)Tincluded in theBDD.static <T> StringReturns a graphical representation of theBDDin the DOT input format.protected static <T> voidtraverseBDD(BDD<T> bdd, Set<BDD<T>> upSort) Traverses the BDD to sort the nodes.
- 
Field Details- 
NEWLINEThe platform-independent newline symbol.
 
- 
- 
Constructor Details- 
BDDspublic BDDs()
 
- 
- 
Method Details- 
getVariablesReturns all variables (elements)Tincluded in theBDD.- Type Parameters:
- T- the type of variables
- Parameters:
- bdd- the bdd
- Returns:
- all variables T included in the bdd
 
- 
getNodesReturns all nodes of theBDDthat represent the variableT.- Type Parameters:
- T- the type of variable
- Parameters:
- t- the variable
- bdd- the bdd
- Returns:
- all nodes in the bdd that represent variable t
 
- 
getBDDpublic static <T> BDD<T> getBDD(List<Integer> coeffs, List<BDD<T>> vars, LinearTerm.Comparator comp, int rhs, BDDProvider<T> provider) Converts a linear constraint to aBDD.- Type Parameters:
- T- the type of variables of the BDD
- Parameters:
- coeffs- the coefficients
- vars- the variables
- comp- the comparator ("<","<=","=",">=",">")
- rhs- the right hand side value
- provider- the bdd provider
- Returns:
- the BDD representing this linear constraint
 
- 
getConstraintBDDprotected static <T> BDD<T> getConstraintBDD(org.jreliability.bdd.BDDConstraint<T> constraint, BDDProvider<T> provider) Returns a greater-equal constraint represented as aBDD.- Type Parameters:
- T- the type of variables
- Parameters:
- constraint- the greater-equal constraint
- provider- the bdd provider
- Returns:
- the bdd representation of the given constraint
 
- 
toDotReturns a graphical representation of theBDDin the DOT input format.- Type Parameters:
- T- the type of variable
- Parameters:
- bdd- the bdd
- Returns:
- the bdd as a DOT input string
- See Also:
 
- 
calculateToppublic static <T> double calculateTop(BDD<T> bdd, org.apache.commons.collections15.Transformer<T, Double> transformer) Calculates the top event of theBDDbased on a functionTransformer that delivers for each variableTa double value.- Type Parameters:
- T- the type of variable
- Parameters:
- bdd- the bdd
- transformer- the transformer that returns a double value for each variable
- Returns:
- the top event of the bdd
 
- 
traverseBDDTraverses the BDD to sort the nodes.- Type Parameters:
- T- the type of variables
- Parameters:
- bdd- the bdd
- upSort- the sorted bdd nodes
 
- 
evaluateprotected static <T> double evaluate(BDD<T> bdd, org.apache.commons.collections15.Transformer<T, Double> transformer, Set<BDD<T>> upSort) Evaluates the BDD to determine the top event.- Type Parameters:
- T- the type of the variables
- Parameters:
- bdd- the bdd
- transformer- the transformer
- upSort- the sorted bdd nodes
- Returns:
- the top event
 
- 
buildConstraintBDDprotected static <T> BDD<T> buildConstraintBDD(List<org.jreliability.bdd.BDDConstraint.Literal<T>> literals, int rhs, int index, int sum, int materialLeft, Map<org.jreliability.bdd.BDDConstraint.Pair<Integer, Integer>, BDD<T>> memo, BDDProvider<T> provider) Returns a greater-equal constraint represented as aBDDvia a recursive procedure proposed by Een & Soerrensson 2006.- Type Parameters:
- T- the type of variables
- Parameters:
- literals- the literals
- rhs- the right hand side of the constraint
- index- the index
- sum- the current sum
- materialLeft- the material that is potentially left to be added to the sum
- memo- the memo maps each point in the recursion to its bdd
- provider- the used bdd provider
- Returns:
- the bdd representation of the given constraint
 
- 
collectDotNodesprotected static <T> void collectDotNodes(BDD<T> bdd, StringBuffer dot, Map<BDD<T>, String> variables, Map<T, Integer> counters) Traverses theBDDto collects all nodes for the DOT representation.- Type Parameters:
- T- the type of variables
- Parameters:
- bdd- the bdd
- dot- the dot input
- variables- the used variables
- counters- the used counters for each element
 
- 
collectDotEdgesprotected static <T> void collectDotEdges(BDD<T> bdd, StringBuffer dot, Map<BDD<T>, String> variables, Set<BDD<T>> considered) Traverses theBDDto collects all edges for the DOT representation.- Type Parameters:
- T- the type of variable
- Parameters:
- bdd- the bdd
- dot- the dot input string
- variables- the used variables
- considered- the marker for already considered bdds
 
- 
collectDotMarkersTraverses theBDDto setup the correct ranks of all nodes belonging to the same variable.- Type Parameters:
- T- the type of variable
- Parameters:
- bdd- the bdd
- dot- the dot input string
- markers- the marker variables for each variable
 
- 
collectDotRanksprotected static <T> void collectDotRanks(BDD<T> bdd, StringBuffer dot, Map<BDD<T>, String> variables, Map<T, String> markers) Traverses theBDDto setup the correct ranks of all nodes belonging to the same variable.- Type Parameters:
- T- the type of variable
- Parameters:
- bdd- the bdd
- dot- the dot input
- variables- the used variables
- markers- the marker variables
 
- 
collectVariablesTraverses theBDDto collect all variables.- Type Parameters:
- T- the type of variables
- Parameters:
- bdd- the bdd
- variables- the variables
- considered- the already considered bdds
 
- 
collectVariablesSorted- Type Parameters:
- T- the type of variables
- Parameters:
- bdd- the bdd
- variables- the variables
 
- 
collectNodesTraverses theBDDto collect all nodes for a given variableT.- Type Parameters:
- T- the type of variables
- Parameters:
- bdd- the bdd
- t- the variable
- considered- the already considered bdds
- nodes- the found nodes
 
 
-