org.jasen.core.calculators
Class CompoundCalculator

java.lang.Object
  extended byorg.jasen.core.calculators.CompoundCalculator
All Implemented Interfaces:
ProbabilityCalculator

public class CompoundCalculator
extends Object
implements ProbabilityCalculator

Calculates the combined probability using the standard compound probability algorithm.

Specifically:

	ab...n / ab...n + (1-a)(1-b)...(1-n)
 

Where: 'a' and 'b' are discrete probabilities

Author:
Jason Polites

Constructor Summary
CompoundCalculator()
           
 
Method Summary
 double calculate(double[] probabilities, int start, int end)
          Calculates the combined probability of the set of probabilities passed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundCalculator

public CompoundCalculator()
Method Detail

calculate

public double calculate(double[] probabilities,
                        int start,
                        int end)
                 throws JasenException
Description copied from interface: ProbabilityCalculator
Calculates the combined probability of the set of probabilities passed

Specified by:
calculate in interface ProbabilityCalculator
Parameters:
probabilities - The probability set
start - The start index in the set to be used
end - The end index in the set to be used
Returns:
A single primitive double between 0.0 and 1.0
Throws:
JasenException