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

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

public class HLErlangDistribution
extends Distribution
implements java.lang.Cloneable

Represents an erlang distribution that can be readily displayed as it maintains its own GUI panel. The distribution will be graphically represented by two spinners representing the number of drawings and the intensity value.
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
HLErlangDistribution(GUIPropertyIntegerTextField n, GUIPropertyDoubleTextField intensity)
          Creates a erlang distribution based on a number of drawings and an intensity value
HLErlangDistribution(int n, double intensity)
          Creates a erlang distribution based on a number of drawings and an intensity 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.
 int getEmergenceOfEvents()
          Retrieves the number of emergence of events for this distribution.
 double getIntensity()
          Retrieves the intensity value for this 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

HLErlangDistribution

public HLErlangDistribution(int n,
                            double intensity)
Creates a erlang distribution based on a number of drawings and an intensity value

Parameters:
n - Emergence of n events. Note that the number of events always has to be equal or greater than 1.
intensity - double the intensity value. Note that the intensity value always has to be equal or greater than 0.

HLErlangDistribution

public HLErlangDistribution(GUIPropertyIntegerTextField n,
                            GUIPropertyDoubleTextField intensity)
Creates a erlang distribution based on a number of drawings and an intensity value

Parameters:
n - Emergence of n events. Note that the number of events always has to be equal or greater than 1.
intensity - double the intensity value. Note that the intensity value always has to be equal or greater than 0.
Method Detail

getEmergenceOfEvents

public int getEmergenceOfEvents()
Retrieves the number of emergence of events for this distribution.

Returns:
int the number of drawings

getIntensity

public double getIntensity()
Retrieves the intensity value for this distribution

Returns:
double the intensity 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)

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

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

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.