Class 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>
    The BDDTTRFSimulative performs a Monte-Carlo simulation to determine the ReliabilityFunction based on a BDD representation of the system structure.
    • Field Detail

      • epsilon

        protected final double epsilon
        The used maximum error epsilon value for the simulation.
      • random

        protected final java.util.Random random
        The used random number generator to trigger the simulation.
    • Constructor Detail

      • BDDTTRFSimulative

        public BDDTTRFSimulative​(BDDProvider<T> provider)
        Constructs a BDDTTRFSimulative with a given BDDProvider and a standard epsilon of 0.001.
        Parameters:
        provider - the used bddProvider
      • BDDTTRFSimulative

        public BDDTTRFSimulative​(BDDProvider<T> provider,
                                 double epsilon)
        Constructs a BDDTTRFSimulative with a given BDDProvider and an epsilon.
        Parameters:
        provider - the used bddProvider
        epsilon - 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 a Term to a ReliabilityFunction.
        Specified by:
        convert in interface TTRF<T>
        Parameters:
        term - the term to transform
        functionTransformer - the used function functionTransformer
        Returns:
        the reliabilityFunction deduced from the term
      • convert

        public ReliabilityFunction convert​(Term term,
                                           org.apache.commons.collections15.Transformer<T,​ReliabilityFunction> functionTransformer,
                                           int j)
        Converts a given Term to a ReliabilityFunction based on j-samples.
        Parameters:
        term - the term to convert
        functionTransformer - the element to reliability function transformer
        j - 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
        Converts a Term to a ReliabilityFunction and excludes the exists variables.
        Specified by:
        convert in interface TTRF<T>
        Parameters:
        term - the term to transform
        functionTransformer - the used function functionTransformer
        existsPredicate - the exists-variable existsPredicate
        Returns:
        the reliabilityFunction deduced from the term
      • convert

        public ReliabilityFunction convert​(Term term,
                                           org.apache.commons.collections15.Transformer<T,​ReliabilityFunction> functionTransformer,
                                           org.apache.commons.collections15.Predicate<T> existsPredicate,
                                           int j)
        Converts a given Term to a ReliabilityFunction based on j-samples.
        Parameters:
        term - the term to convert
        functionTransformer - the element to reliability function transformer
        existsPredicate - the element to exists predicate
        j - 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 derive 5000 samples needed to calculate the ReliabilityFunction.
        Parameters:
        term - the term to convert
        functionTransformer - the element to reliability function transformer
        existsPredicate - 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 derive n samples needed to calculate the ReliabilityFunction.
        Parameters:
        term - the term to convert
        functionTransformer - the element to reliability function transformer
        existsPredicate - the element to exists predicate
        n - 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 bdd
        functionTransformer - 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 the Failure occurrences for a single simulation run based on the given BDD and the ReliabilityFunctions of its elements.
        Parameters:
        bdd - the given bdd
        functionTransformer - the element to reliability function transformer
        Returns:
        the failure occurrences for a single simulation run