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

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

public class HLUniformDistribution
extends Distribution
implements java.lang.Cloneable

Represents a uniform distribution that can be readily displayed as it maintains its own GUI panel. The distribution will be graphically represented by two spinners representing the minimum value and the maximum, respectively.
Changes performed via the GUI will be immedeately propagated to the internally held property values. It is assumed that the min value that is provided will be less than the max value that is provided.

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
HLUniformDistribution(double min, double max)
          Creates a normal distribution based on a minimal and a maximal value.
HLUniformDistribution(GUIPropertyDoubleTextField min, GUIPropertyDoubleTextField max)
          Creates a normal distribution based on a minimal and a maximal value.
 
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.
 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 getMax()
          Returns the maximum value of this uniform distribution.
 double getMin()
          Returns the minimum value of this uniform 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()
           
 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

HLUniformDistribution

public HLUniformDistribution(double min,
                             double max)
Creates a normal distribution based on a minimal and a maximal value.

Parameters:
min - the minumum value of the distribution
max - the maximum value of the distribution

HLUniformDistribution

public HLUniformDistribution(GUIPropertyDoubleTextField min,
                             GUIPropertyDoubleTextField max)
Creates a normal distribution based on a minimal and a maximal value.

Parameters:
min - the minumum value of the distribution
max - the maximum value of the distribution
Method Detail

getMin

public double getMin()
Returns the minimum value of this uniform distribution.

Returns:
the minimum value

getMax

public double getMax()
Returns the maximum value of this uniform distribution.

Returns:
the maximum value

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()
Description copied from class: Distribution
Implementing classes have to override the clone method

Overrides:
clone in class Distribution
Returns:
Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.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.