Package org.jreliability.bdd
Class BDDTTRFSimulative<T>
- java.lang.Object
-
- org.jreliability.bdd.BDDTTRFSimulative<T>
-
- Type Parameters:
T
- the elements of the bdd
- All Implemented Interfaces:
TTRF<T>
public class BDDTTRFSimulative<T> extends java.lang.Object implements TTRF<T>
TheBDDTTRFSimulative
performs a Monte-Carlo simulation to determine theReliabilityFunction
based on aBDD
representation of the system structure.
-
-
Field Summary
Fields Modifier and Type Field Description protected double
epsilon
The used maximum errorepsilon
value for the simulation.protected BDDProvider<T>
provider
The usedBDDProvider
.protected java.util.Random
random
The used random number generator to trigger the simulation.
-
Constructor Summary
Constructors Constructor Description BDDTTRFSimulative(BDDProvider<T> provider)
BDDTTRFSimulative(BDDProvider<T> provider, double epsilon)
Constructs aBDDTTRFSimulative
with a givenBDDProvider
and an epsilon.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Double>
collectTimesToFailure(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer, org.apache.commons.collections15.Predicate<T> existsPredicate)
Collects all times-to-failure to derive5000
samples needed to calculate theReliabilityFunction
.java.util.List<java.lang.Double>
collectTimesToFailure(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer, org.apache.commons.collections15.Predicate<T> existsPredicate, int n)
Collects all times-to-failure to deriven
samples needed to calculate theReliabilityFunction
.ReliabilityFunction
convert(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer)
Converts aTerm
to aReliabilityFunction
.ReliabilityFunction
convert(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer, int j)
ReliabilityFunction
convert(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer, org.apache.commons.collections15.Predicate<T> existsPredicate)
ReliabilityFunction
convert(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer, org.apache.commons.collections15.Predicate<T> existsPredicate, int j)
protected java.util.Set<Failure<T>>
getFailures(BDD<T> bdd, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer)
Generates theFailure
occurrences for a single simulation run based on the givenBDD
and theReliabilityFunction
s of its elements.protected double
simulateTimeToFailure(BDD<T> bdd, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer)
Performs a single simulation run to gather one time-to-failure.
-
-
-
Field Detail
-
epsilon
protected final double epsilon
The used maximum errorepsilon
value for the simulation.
-
random
protected final java.util.Random random
The used random number generator to trigger the simulation.
-
provider
protected final BDDProvider<T> provider
The usedBDDProvider
.
-
-
Constructor Detail
-
BDDTTRFSimulative
public BDDTTRFSimulative(BDDProvider<T> provider)
- Parameters:
provider
- the used bddProvider
-
BDDTTRFSimulative
public BDDTTRFSimulative(BDDProvider<T> provider, double epsilon)
Constructs aBDDTTRFSimulative
with a givenBDDProvider
and an epsilon.- Parameters:
provider
- the used bddProviderepsilon
- the used epsilon value
-
-
Method Detail
-
convert
public ReliabilityFunction convert(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer)
Description copied from interface:TTRF
Converts aTerm
to aReliabilityFunction
.
-
convert
public ReliabilityFunction convert(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer, int j)
- Parameters:
term
- the term to convertfunctionTransformer
- the element to reliability function transformerj
- the number of samples to use- Returns:
- the reliability function
-
convert
public ReliabilityFunction convert(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer, org.apache.commons.collections15.Predicate<T> existsPredicate)
Description copied from interface:TTRF
-
convert
public ReliabilityFunction convert(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer, org.apache.commons.collections15.Predicate<T> existsPredicate, int j)
- Parameters:
term
- the term to convertfunctionTransformer
- the element to reliability function transformerexistsPredicate
- the element to exists predicatej
- the number of samples to use- Returns:
- the reliability function
-
collectTimesToFailure
public java.util.List<java.lang.Double> collectTimesToFailure(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer, org.apache.commons.collections15.Predicate<T> existsPredicate)
Collects all times-to-failure to derive5000
samples needed to calculate theReliabilityFunction
.- Parameters:
term
- the term to convertfunctionTransformer
- the element to reliability function transformerexistsPredicate
- the element to exists predicate- Returns:
- the reliability function
-
collectTimesToFailure
public java.util.List<java.lang.Double> collectTimesToFailure(Term term, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer, org.apache.commons.collections15.Predicate<T> existsPredicate, int n)
Collects all times-to-failure to deriven
samples needed to calculate theReliabilityFunction
.- Parameters:
term
- the term to convertfunctionTransformer
- the element to reliability function transformerexistsPredicate
- the element to exists predicaten
- the number of samples- Returns:
- the reliability function
-
simulateTimeToFailure
protected double simulateTimeToFailure(BDD<T> bdd, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer)
Performs a single simulation run to gather one time-to-failure.- Parameters:
bdd
- the given bddfunctionTransformer
- the element to reliability function transformer- Returns:
- a single time-to-failure
-
getFailures
protected java.util.Set<Failure<T>> getFailures(BDD<T> bdd, org.apache.commons.collections15.Transformer<T,ReliabilityFunction> functionTransformer)
Generates theFailure
occurrences for a single simulation run based on the givenBDD
and theReliabilityFunction
s of its elements.- Parameters:
bdd
- the given bddfunctionTransformer
- the element to reliability function transformer- Returns:
- the failure occurrences for a single simulation run
-
-