|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--unl.cusack.estimator.EstimatorModel | +--unl.cusack.estimator.PiEstimatorModel
A subclass of EstimatorModel that estimates the value of PI by using the formula pi=4-(4/3)+(4/5)-(4/7)+...
Field Summary |
Fields inherited from class unl.cusack.estimator.EstimatorModel |
estimates, estimatorListeners |
Constructor Summary | |
PiEstimatorModel()
The plain-jane constructor. |
Method Summary | |
double |
computePiEstimate(int n)
Computes the partial sum to estimate pi. |
void |
recalculateEstimates()
From the abstract classs recalculates each of the estimates, based on the formula, and the parameters. |
Methods inherited from class unl.cusack.estimator.EstimatorModel |
addEstimatorListener, dataChanged, getEstimate, getEstimatorInterval, getFirstEstimate, getMaximumEstimate, getMinimumEstimate, getNumberOfEstimates, setEstimateInterval, setFirstEstimate, setNumberOfEstimates, setParameters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PiEstimatorModel()
Method Detail |
public double computePiEstimate(int n)
n
- the last index of the sumpublic void recalculateEstimates()
recalculateEstimates
in class EstimatorModel
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |