org.processmining.exporting.petrinet.cpnexport.HLImplementation.HLDistribution
Class HLGeneralDistribution

java.lang.Object
  extended by org.processmining.framework.models.hlprocess.Distribution
      extended by org.processmining.exporting.petrinet.cpnexport.HLImplementation.HLDistribution.HLGeneralDistribution
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, GuiNotificationTarget

public class HLGeneralDistribution
extends Distribution
implements java.lang.Cloneable, GuiNotificationTarget

Represents a general distribution to which a lot of distribution related information can be provided, so that based on the provided information to this object separate distributions (like a HLUniformDistribution object or a HLNormalDistribution) can be provided. If no specific value for some distribution related attribute has been set, a default value will be used (e.g. when no value for variance is given, as value 0 will be used). For setting the best distribution, an instance of HLGeneralDistribution.DistributionEnum has to be invoked. Note that a type has to be added to DistributionEnum in case that it has to be possible to set some more best distributions.

Author:
arozinat, rmans
See Also:

It is assumed that if a min and a max value is provided, that the min value is less than the max value.
, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.processmining.framework.models.hlprocess.Distribution
Distribution.DistributionEnum
 
Constructor Summary
HLGeneralDistribution()
          Creates a general distribution with default values.
HLGeneralDistribution(double constant, double intensity, Distribution.DistributionEnum bestDistribution)
          Creates a general distribution with default values for some of the values in the generaldistribution
HLGeneralDistribution(double constant, double mean, double variance, double min, double max, Distribution.DistributionEnum bestDistribution)
          Creates a general distribution with default values for some of the values in the generaldistribution
HLGeneralDistribution(double constant, double mean, double variance, double min, double max, double intensity, Distribution.DistributionEnum bestDistribution)
          Creates a general distribution with default values for some of the values in the generaldistribution
HLGeneralDistribution(double constant, double mean, double variance, double min, double max, double intensity, double probability, int numberExperiments, int degreesFreedom, int emergenceEvents, Distribution.DistributionEnum bestDistribution)
          Creates a general distribution based on values for the mean, variance, min, max and the bestDistribution
 
Method Summary
 boolean checkValuesOfTimeParameters(java.lang.String info)
          Check whether parameters, which can be related to time, in the Distribution will get value '0' when these are rounded.
 java.lang.Object clone()
          Implementing classes have to override the clone method
 boolean equals(java.lang.Object obj)
          Determines when two distribution objects are the same.
 HLBernoulliDistribution getBernoulliDistribution()
          Returns a HLBernoulliDistribution object.
 Distribution.DistributionEnum getBestDistribution()
          Returns the number of the best distribution that has been set.
 java.lang.String getBestDistributionString()
          Returns the name of the best distribution that has been set.
 HLBinomialDistribution getBinomialDistribution()
          Returns a HLBinomialDistribution object.
 HLChiSquareDistribution getChiSquareDistribution()
          Returns a HLChiSquareDistribution object.
 double getConstant()
          Returns the constant of the general distribution
 HLConstantDistribution getConstantDistribution()
          Returns a HLConstantDistribution object.
 java.lang.String getCpnDistributionFunction()
          Returns the cpn distribution function of the distribution that has been indicated as best one.
 int getDegreesOfFreedom()
          Returns the degrees of freedom of the general distribution
 HLDiscreteDistribution getDiscreteDistribution()
          Returns a HLDiscreteDistribution object.
 javax.swing.JPanel getDistributionPanel()
          Creates GUI panel representing this general distribution, ready to display in some settings dialog.
 java.util.ArrayList<Distribution> getDistributions()
          All possible distributions will be returned.
 Distribution.DistributionEnum getDistributionType()
          Indicates the type of this distribution.
 int getEmergenceofEvents()
          Returns the number of emergence of events of the general distribution
 HLErlangDistribution getErlangDistribution()
          Returns a HLErlangDistribution object.
 HLExponentialDistribution getExponentialDistribution()
          Returns a HLExponentialDistribution object.
 double getIntensity()
          Returns the intensity of the general distribution
 double getMax()
          Returns the max value of the general distribution
 double getMean()
          Returns the mean value of the general distribution.
 double getMin()
          Returns the min of the general distribution
 HLNormalDistribution getNormalDistribution()
          Returns a HLNormalDistribution object.
 int getNumberExperiments()
          Returns the number of experiments of the general distribution
 HLPoissonDistribution getPoissonDistribution()
          Returns a HLPoissonDistribution object.
 double getProbability()
          Returns the probability value of the general distribution.
 HLStudentDistribution getStudentDistribution()
          Returns a HLStudentDistribution object.
 HLUniformDistribution getUniformDistribution()
          Returns a HLUniformDistribution object.
 double getVariance()
          Returns the variance of the general distribution.
 int hashCode()
          Retrieves the hashcode for the object.
 void setBestDistribution(Distribution.DistributionEnum bestDistribution)
          Sets the best distribution.
 void setConstant(double constant)
          Sets the constant of the general distribution
 void setDegreesOfFreedom(int degreesFreedom)
          Sets the degrees of freedom for the general distribution
 void setEmergenceOfEvents(int emergenceEvents)
          Sets the emergence of events for the general distribution
 void setIntensity(double intensity)
          Sets the intensity of the general distribution
 void setMax(double max)
          Sets the max of the general distribution
 void setMean(double mean)
          Sets the mean value of this general distribution
 void setMin(double min)
          Sets the min of the general distribution
 void setNumberExperiments(int numberExperiments)
          Sets the number of experiments for the general distribution
 void setProbability(double probability)
          Sets the probability of the general distribution.
 void setVariance(double variance)
          Sets the variance of the general distribution.
 void timeMultiplicationValue(double value)
          Defines the factor with which the values in the distribution that refer to time need to be multiplicated with
 void updateGUI()
          This method is called as soon the attribute type of this data attribute is changed.
 void updateGUI2()
           
 void writeDistributionToDot(java.lang.String boxId, java.lang.String nodeId, java.lang.String addText, java.io.Writer bw)
          Writes the distribution to dot.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HLGeneralDistribution

public HLGeneralDistribution(double constant,
                             double mean,
                             double variance,
                             double min,
                             double max,
                             double intensity,
                             double probability,
                             int numberExperiments,
                             int degreesFreedom,
                             int emergenceEvents,
                             Distribution.DistributionEnum bestDistribution)
Creates a general distribution based on values for the mean, variance, min, max and the bestDistribution

Parameters:
constant - the constant value of the distribution
mean - double (arithmetic) mean value of the distribution
variance - double the variance of the distribution
min - the minumum value of the distribution
max - the maximum value of the distribution
probability - the probability value. Note that this value always has to be bigger or equal to 0 and equal or less than 1.
numberExperiments - the number of experiments. Note that this value always has to bigger or equal to 1.
degreesFreedom - double the degrees of freedom value. Not that this value always has to be equal or greater to 1.
emergenceEvents - Emergence of emergenceEvents events. Note that the number of events always has to be equal or greater than 1.
intensity - the intensity value of the distribution
bestDistribution - the best distribution. Based on the values that are provided

HLGeneralDistribution

public HLGeneralDistribution()
Creates a general distribution with default values.


HLGeneralDistribution

public HLGeneralDistribution(double constant,
                             double mean,
                             double variance,
                             double min,
                             double max,
                             Distribution.DistributionEnum bestDistribution)
Creates a general distribution with default values for some of the values in the generaldistribution

Parameters:
constant - the constant value of the distribution
mean - double (arithmetic) mean value of the distribution
variance - double the variance of the distribution
min - the minumum value of the distribution
max - the maximum value of the distribution
bestDistribution - the best distribution. Based on the values that are provided

HLGeneralDistribution

public HLGeneralDistribution(double constant,
                             double intensity,
                             Distribution.DistributionEnum bestDistribution)
Creates a general distribution with default values for some of the values in the generaldistribution

Parameters:
constant - double the constant value of the distribution
intensity - double the intensity value of the distribution
bestDistribution - DistributionEnum the best distribution. Based on the values that are provided.

HLGeneralDistribution

public HLGeneralDistribution(double constant,
                             double mean,
                             double variance,
                             double min,
                             double max,
                             double intensity,
                             Distribution.DistributionEnum bestDistribution)
Creates a general distribution with default values for some of the values in the generaldistribution

Parameters:
constant - double the constant value of the distribution
mean - double the mean value of the distribution
min - double the min value of the distribution
max - double the max value of the distribution
variance - double the variance value of the distribution
intensity - double the intensity value of the distribution
bestDistribution - DistributionEnum the best distribution. Based on the values that are provided.
Method Detail

setBestDistribution

public void setBestDistribution(Distribution.DistributionEnum bestDistribution)
Sets the best distribution.

Parameters:
bestDistribution - DistributionEnum the best distribution

getBestDistribution

public Distribution.DistributionEnum getBestDistribution()
Returns the number of the best distribution that has been set.

Returns:
DistributionEnum the number of the best distribution

getBestDistributionString

public java.lang.String getBestDistributionString()
Returns the name of the best distribution that has been set.

Returns:
String the name of the best distribution.

setConstant

public void setConstant(double constant)
Sets the constant of the general distribution

Parameters:
constant - double the constant value

getConstant

public double getConstant()
Returns the constant of the general distribution

Returns:
double the constant value

setMean

public void setMean(double mean)
Sets the mean value of this general distribution

Parameters:
mean - double the mean value

getMean

public double getMean()
Returns the mean value of the general distribution.

Returns:
double the mean value

setVariance

public void setVariance(double variance)
Sets the variance of the general distribution.

Parameters:
variance - double the variance.

getVariance

public double getVariance()
Returns the variance of the general distribution.

Returns:
double the variance.

setMax

public void setMax(double max)
Sets the max of the general distribution

Parameters:
max - double the max value. Note that the max value always has to be bigger or equal to the min value (if it has been provided).

getMax

public double getMax()
Returns the max value of the general distribution

Returns:
double the max value

setMin

public void setMin(double min)
Sets the min of the general distribution

Parameters:
min - double the min value. Note that the min value always has to be less or equal than the max value (if it has been provided).

getMin

public double getMin()
Returns the min of the general distribution

Returns:
double the min value

setIntensity

public void setIntensity(double intensity)
Sets the intensity of the general distribution

Parameters:
intensity - double the intensity value. Note that this value always has to be bigger or equal to 1.

getIntensity

public double getIntensity()
Returns the intensity of the general distribution

Returns:
double the intensity value.

setProbability

public void setProbability(double probability)
Sets the probability of the general distribution.

Parameters:
probability - double the probability value. Note that this value always has to be bigger or equal to 0 and less than or equal to 1.

getProbability

public double getProbability()
Returns the probability value of the general distribution.

Returns:
double the probability value.

setNumberExperiments

public void setNumberExperiments(int numberExperiments)
Sets the number of experiments for the general distribution

Parameters:
numberExperiments - int the number of experiments. Note that this value always has to be bigger or equal to 1.

getNumberExperiments

public int getNumberExperiments()
Returns the number of experiments of the general distribution

Returns:
int the number of experiments.

setDegreesOfFreedom

public void setDegreesOfFreedom(int degreesFreedom)
Sets the degrees of freedom for the general distribution

Parameters:
degreesFreedom - int the degrees of freedom. Note that this value always has to be bigger or equal to 1.

getDegreesOfFreedom

public int getDegreesOfFreedom()
Returns the degrees of freedom of the general distribution

Returns:
int the degrees of freedom

setEmergenceOfEvents

public void setEmergenceOfEvents(int emergenceEvents)
Sets the emergence of events for the general distribution

Parameters:
emergenceEvents - int the emergence of emergenceEvents events. Note that this value always has to be bigger or equal to 1.

getEmergenceofEvents

public int getEmergenceofEvents()
Returns the number of emergence of events of the general distribution

Returns:
int the number of emergence of events.

getDistributions

public java.util.ArrayList<Distribution> getDistributions()
All possible distributions will be returned.
If no specific value has been set for some distribution related attribute, a default value will be used instead. Note that the indicated best distribution is the first element in the list (and therefore will be displayed as the default value in the corresponding enumeration property allowing to choose a distribution).

Returns:
ArrayList all possible distributions (Distribution)

getUniformDistribution

public HLUniformDistribution getUniformDistribution()
Returns a HLUniformDistribution object. If no specific value has been set for some attribute specifically related to this distribution, a default value will be used.

Returns:
HLUniformDistribution a HLUniformDistribution object.

getNormalDistribution

public HLNormalDistribution getNormalDistribution()
Returns a HLNormalDistribution object. If no specific value has been set for some attribute specifically related to this distribution, a default value will be used.

Returns:
HLNormalDistribution a HLNormalDistribution object.

getConstantDistribution

public HLConstantDistribution getConstantDistribution()
Returns a HLConstantDistribution object. If no specific value has been set for some attribute specifically related to this distribution, a default value will be used.

Returns:
HLConstantDistribution a HLConstantDistribution object.

getExponentialDistribution

public HLExponentialDistribution getExponentialDistribution()
Returns a HLExponentialDistribution object. If no specific value has been set for some attribute specifically related to this distribution, a default value will be used.

Returns:
HLExponentialDistribution a HLExponentialDistribution object.

getBernoulliDistribution

public HLBernoulliDistribution getBernoulliDistribution()
Returns a HLBernoulliDistribution object. If no specific value has been set for some attribute specifically related to this distribution, a default value will be used.

Returns:
HLBernoulliDistribution a HLBernoulliDistribution object.

getBinomialDistribution

public HLBinomialDistribution getBinomialDistribution()
Returns a HLBinomialDistribution object. If no specific value has been set for some attribute specifically related to this distribution, a default value will be used.

Returns:
HLBinomialDistribution a HLBinomialDistribution object.

getChiSquareDistribution

public HLChiSquareDistribution getChiSquareDistribution()
Returns a HLChiSquareDistribution object. If no specific value has been set for some attribute specifically related to this distribution, a default value will be used.

Returns:
HLChiSquareDistribution a HLChiSquareDistribution object.

getDiscreteDistribution

public HLDiscreteDistribution getDiscreteDistribution()
Returns a HLDiscreteDistribution object. If no specific value has been set for some attribute specifically related to this distribution, a default value will be used. Note that for this distribution the min and max value of the general distribution are rounded to the closest int, because the min and max value that are supplied to the general distribution are of type double.

Returns:
HLDiscreteDistribution a HLDiscreteDistribution object.

getErlangDistribution

public HLErlangDistribution getErlangDistribution()
Returns a HLErlangDistribution object. If no specific value has been set for some attribute specifically related to this distribution, a default value will be used.

Returns:
HLErlangDistribution a HLErlangDistribution object.

getPoissonDistribution

public HLPoissonDistribution getPoissonDistribution()
Returns a HLPoissonDistribution object. If no specific value has been set for some attribute specifically related to this distribution, a default value will be used.

Returns:
HLPoissonDistribution a HLPoissonDistribution object.

getStudentDistribution

public HLStudentDistribution getStudentDistribution()
Returns a HLStudentDistribution object. If no specific value has been set for some attribute specifically related to this distribution, a default value will be used.

Returns:
HLStudentDistribution a HLStudentDistribution object.

updateGUI2

public void updateGUI2()

getCpnDistributionFunction

public java.lang.String getCpnDistributionFunction()
Returns the cpn distribution function of the distribution that has been indicated as best one.

Specified by:
getCpnDistributionFunction in class Distribution
Returns:
String the cpn distribution function for the the best distribution.

getDistributionType

public Distribution.DistributionEnum getDistributionType()
Description copied from class: Distribution
Indicates the type of this distribution.

Specified by:
getDistributionType in class Distribution
Returns:
the type of this distribution

getDistributionPanel

public javax.swing.JPanel getDistributionPanel()
Creates GUI panel representing this general distribution, ready to display in some settings dialog.
Note that it will be possible to change between the different distribution views. If one particular distribution is desired, it should be requested and directly displayed instead.

Specified by:
getDistributionPanel in class Distribution
Returns:
the graphical panel representing this distribution

updateGUI

public void updateGUI()
This method is called as soon the attribute type of this data attribute is changed. The reason is that the possible values and initial values are different for the different types of data attributes.

Specified by:
updateGUI in interface GuiNotificationTarget

clone

public java.lang.Object clone()
Description copied from class: Distribution
Implementing classes have to override the clone method

Overrides:
clone in class Distribution
Returns:
Object

equals

public boolean equals(java.lang.Object obj)
Description copied from class: Distribution
Determines when two distribution objects are the same. Two Distributions are the same when they are both of the same object type and that the values for all the parameters of the particular distribution are the same.

Specified by:
equals in class Distribution
Parameters:
obj - Object the object to compare with
Returns:
boolean true when the two distribution objects are the same object and that the values for all the parameters of the particalur distribution are the same. false otherwise

hashCode

public int hashCode()
Description copied from class: Distribution
Retrieves the hashcode for the object. The hashcode value for a Distribution object is calculated according to the recipe of Josha Bloch in Effective Java (Addison-Wesley 2001). For this recipe it is only allowed to consider the fields that correspond with the parameter(s) of the particular distribution.

Specified by:
hashCode in class Distribution
Returns:
int the hashcode value for the Distribution object.

writeDistributionToDot

public void writeDistributionToDot(java.lang.String boxId,
                                   java.lang.String nodeId,
                                   java.lang.String addText,
                                   java.io.Writer bw)
                            throws java.io.IOException
Description copied from class: Distribution
Writes the distribution to dot. The general idea is that the parameters and other relevant information of the distribution are written in a box and if needed can be connected to another node in the dot file. In that case the connection has to be an undirected line.

Specified by:
writeDistributionToDot in class Distribution
Parameters:
boxId - the identifier of the box (in the DOT file) in which the parameters and other relevant information of the distribution will be written.
nodeId - the identifier of the node (in the DOT file) to which the box that will be created has to be connected. "" has to be provided if the box that will be created does not need to be connected to another node in the DOT file.
addText - additional text that needs to be filled in at the beginning of the box
bw - Writer the BufferedWriter used to stream the data to the file
Throws:
java.io.IOException

timeMultiplicationValue

public void timeMultiplicationValue(double value)
Description copied from class: Distribution
Defines the factor with which the values in the distribution that refer to time need to be multiplicated with

Specified by:
timeMultiplicationValue in class Distribution
Parameters:
value - double

checkValuesOfTimeParameters

public boolean checkValuesOfTimeParameters(java.lang.String info)
Description copied from class: Distribution
Check whether parameters, which can be related to time, in the Distribution will get value '0' when these are rounded. When such a parameter gets value '0' after rounding, a warning needs to be issued. Furthermore, when a warning is raised the value 'true' needs to be returned

Specified by:
checkValuesOfTimeParameters in class Distribution
Parameters:
info - Additional information to be displayed when a warning is issued.
Returns:
boolean the value true needs to be returned when a warning has been issued by the method, otherwise false.