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

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

public class HLNormalDistribution
extends Distribution
implements java.lang.Cloneable

Represents a normal distribution that can be readily displayed as it maintains its own GUI panel. The distribution will be graphically represented by two spinners representing the mean value and the variance, respectively.
Changes performed via the GUI will be immedeately propagated to the internally held property values.

Author:
arozinat, rmans
See Also:
getDistributionPanel, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.processmining.framework.models.hlprocess.Distribution
Distribution.DistributionEnum
 
Constructor Summary
HLNormalDistribution(double mean, double variance)
          Creates a normal distribution based on a mean and a variance.
HLNormalDistribution(GUIPropertyDoubleTextField mean, GUIPropertyDoubleTextField variance)
          Creates a normal distribution from existing DoubleProperties.
 
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()
          Clones this object
 boolean equals(java.lang.Object obj)
          Determines when two distribution objects are the same.
 java.lang.String getCpnDistributionFunction()
          Returns the cpn-specific distribution function (cpn syntax).
 javax.swing.JPanel getDistributionPanel()
          Creates GUI panel representing this distribution, ready to display in some settings dialog.
 Distribution.DistributionEnum getDistributionType()
          Indicates the type of this distribution.
 double getMean()
          Returns the mean value of this normal distribution.
 double getVariance()
          Returns the variance of this normal distribution.
 int hashCode()
          Retrieves the hashcode for the object.
 void timeMultiplicationValue(double value)
          Defines the factor with which the values in the distribution that refer to time need to be multiplicated with
 java.lang.String toString()
          The string representation for this distribution.
 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, wait, wait, wait
 

Constructor Detail

HLNormalDistribution

public HLNormalDistribution(double mean,
                            double variance)
Creates a normal distribution based on a mean and a variance.

Parameters:
mean - the (arithmetic) mean value of the distribution
variance - the variance of the distribution

HLNormalDistribution

public HLNormalDistribution(GUIPropertyDoubleTextField mean,
                            GUIPropertyDoubleTextField variance)
Creates a normal distribution from existing DoubleProperties.

Parameters:
mean - the (arithmetic) mean value of the distribution
variance - the variance of the distribution
Method Detail

getMean

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

Returns:
the mean value

getVariance

public double getVariance()
Returns the variance of this normal distribution.

Returns:
the variance

getCpnDistributionFunction

public java.lang.String getCpnDistributionFunction()
Description copied from class: Distribution
Returns the cpn-specific distribution function (cpn syntax).

Specified by:
getCpnDistributionFunction in class Distribution
Returns:
String the cpn-specific distribution function (cpn syntax)

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()
Description copied from class: Distribution
Creates GUI panel representing this distribution, ready to display in some settings dialog.

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

clone

public java.lang.Object clone()
Clones this object

Overrides:
clone in class Distribution
Returns:
Object the cloned object.

toString

public java.lang.String toString()
The string representation for this distribution.

Overrides:
toString in class java.lang.Object
Returns:
String the string representation.

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.