Class NormalPar
java.lang.Object
random.AbstractParameter
random.NormalPar
This is the parameter that should be passed to the Normal
distribution.
Copyright (c) 2003
Politecnico di Milano - dipartimento di Elettronica e Informazione
Copyright (c) 2003
Politecnico di Milano - dipartimento di Elettronica e Informazione
- Author:
- Fabrizio Frontera - ffrontera@yahoo.it
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheck()It verifies that the parameter is correct.doublegetMean()It returns the value of the mean of the normal distribution.doubleIt returns the value of the standard deviation of the normal distribution.voidsetMean(double mean) It allows the user to change the value of the mean of the normal distribution.voidsetStandardDeviation(double standardDeviation) It allows the user to change the value of the standard deviation of the normal distribution and verifies if it is greater than zero.
-
Constructor Details
-
NormalPar
public NormalPar(double mean, double standardDeviation) throws IncorrectDistributionParameterException It creates a new normal parameter according to the data provided by the user: the mean and the standard deviation of the normal distribution.- Parameters:
mean- double containing the mean of the normal distribution.standardDeviation- double containing the standard deviation of the normal distribution.- Throws:
IncorrectDistributionParameterException- if the standard deviation is not greater than zero.
-
NormalPar
public NormalPar(Double wmean, Double wstandardDeviation) throws IncorrectDistributionParameterException
-
-
Method Details
-
check
public boolean check()It verifies that the parameter is correct. For the normal distribution, the parameter is right if the standard deviation is greater than zero. -
getMean
public double getMean()It returns the value of the mean of the normal distribution.- Returns:
- double with the mean of the normal distribution.
-
getStandardDeviation
public double getStandardDeviation()It returns the value of the standard deviation of the normal distribution.- Returns:
- double with the standard deviation of the normal distribution.
-
setMean
It allows the user to change the value of the mean of the normal distribution.- Specified by:
setMeanin interfaceParameter- Overrides:
setMeanin classAbstractParameter- Parameters:
mean- double indicating the mean of the normal distribution.- Throws:
IncorrectDistributionParameterException
-
setStandardDeviation
public void setStandardDeviation(double standardDeviation) throws IncorrectDistributionParameterException It allows the user to change the value of the standard deviation of the normal distribution and verifies if it is greater than zero.- Parameters:
standardDeviation- double indicating the standard deviation of the normal distribution.- Throws:
IncorrectDistributionParameterException- if the standard deviation is not greater than zero.
-