org.processmining.framework.models.hlprocess
Class Distribution

java.lang.Object
  extended by org.processmining.framework.models.hlprocess.Distribution
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
HLBernoulliDistribution, HLBinomialDistribution, HLChiSquareDistribution, HLConstantDistribution, HLDiscreteDistribution, HLErlangDistribution, HLExponentialDistribution, HLGeneralDistribution, HLNormalDistribution, HLPoissonDistribution, HLStudentDistribution, HLUniformDistribution

public abstract class Distribution
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This abstract class represents some distribution of a set of numerical values. Subclasses may implement concrete distributions, such as a normal or a uniform distribution.

Author:
arozinat, rmans
See Also:
Serialized Form

Nested Class Summary
static class Distribution.DistributionEnum
          Defines which kinds of distributions are available.
 
Constructor Summary
Distribution()
           
 
Method Summary
abstract  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
abstract  boolean equals(java.lang.Object obj)
          Determines when two distribution objects are the same.
abstract  java.lang.String getCpnDistributionFunction()
          Returns the cpn-specific distribution function (cpn syntax).
abstract  javax.swing.JPanel getDistributionPanel()
          Creates GUI panel representing this distribution, ready to display in some settings dialog.
abstract  Distribution.DistributionEnum getDistributionType()
          Indicates the type of this distribution.
abstract  int hashCode()
          Retrieves the hashcode for the object.
abstract  void timeMultiplicationValue(double multiplicationValue)
          Defines the factor with which the values in the distribution that refer to time need to be multiplicated with
abstract  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

Distribution

public Distribution()
Method Detail

getCpnDistributionFunction

public abstract java.lang.String getCpnDistributionFunction()
Returns the cpn-specific distribution function (cpn syntax).

Returns:
String the cpn-specific distribution function (cpn syntax)

getDistributionPanel

public abstract javax.swing.JPanel getDistributionPanel()
Creates GUI panel representing this distribution, ready to display in some settings dialog.

Returns:
the graphical panel representing this distribution

getDistributionType

public abstract Distribution.DistributionEnum getDistributionType()
Indicates the type of this distribution.

Returns:
the type of this distribution

clone

public java.lang.Object clone()
Implementing classes have to override the clone method

Overrides:
clone in class java.lang.Object
Returns:
Object

equals

public abstract boolean equals(java.lang.Object obj)
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.

Overrides:
equals in class java.lang.Object
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 abstract int hashCode()
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.

Overrides:
hashCode in class java.lang.Object
Returns:
int the hashcode value for the Distribution object.

writeDistributionToDot

public abstract void writeDistributionToDot(java.lang.String boxId,
                                            java.lang.String nodeId,
                                            java.lang.String addText,
                                            java.io.Writer bw)
                                     throws java.io.IOException
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.

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 abstract void timeMultiplicationValue(double multiplicationValue)
Defines the factor with which the values in the distribution that refer to time need to be multiplicated with

Parameters:
multiplicationValue - double

checkValuesOfTimeParameters

public abstract 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. 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

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.