org.processmining.framework.models.petrinet.algorithms.logReplay
Class AnalysisConfiguration

java.lang.Object
  extended by org.processmining.framework.models.petrinet.algorithms.logReplay.AnalysisConfiguration
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ConformanceAnalysisConfiguration

public class AnalysisConfiguration
extends java.lang.Object
implements java.lang.Cloneable

A configuration object represents some unit or category within the respective analysis domain. It is structured in a hierarchical way, that is, a category may contain arbitrary levels of sub-categories, which are automatically layouted according to this scheme in the getOptionsPanel method, which can be used to display the available settings to the user before actual analysis takes place.
Furthermore the configuration object may be passed to the respective analyse passed in order to only take those measurements that are needed for the analysis options chosen by the user.
Typically, each leaf node represents a concrete metric and can be associated to some kind of analysis method, which needs to be applied in order to obtain the information needed for calculating the metric. Note that the hierarchical structure represented by an object of this class does not necessarily correspond to a grouping according to the kind of analysis method, but rather forms a semantic scheme.
Note that the public methods are synchronized as the configuration object may be accessed by concurrent threads executing the different analysis methods.

Author:
Anne Rozinat

Constructor Summary
AnalysisConfiguration()
          Default constructor.
 
Method Summary
 void addAnalysisResult(AnalysisResult result)
          Adds another result object to the list of analysis results held by this category.
 void addChildConfiguration(AnalysisConfiguration newChild)
          Adds a new analysis option as a sub category of this kind of analysis.
 void addRequestedMethod(AnalysisMethodEnum methodEnum)
          Registers this top level category to be provided by the results from the specified analysis method.
 java.lang.Object clone()
          Makes a deep copy of this object.
 AnalysisConfiguration findNode(java.lang.String name)
          Finds the first node in the configuration tree that has the given name.
 java.util.HashSet<AnalysisMethodEnum> getAnalysisMethods()
          Gets the analysis method attributes, which indicates which kind of technique must be used in order to make use of this analysis option.
 java.util.ArrayList<AnalysisConfiguration> getChildConfigurations()
          Gets the list of subordinate analysis configuration options.
 java.util.Set<AnalysisResult> getChildrenResultObjects()
          Gets the results of the child configurations.
 java.lang.String getDescription()
          Gets the description attribute, which should contain sufficient information about this analysis option that the user is able to choose for it or not.
 java.util.ArrayList<AnalysisConfiguration> getEnabledOptionsForAnalysisMethod(java.util.ArrayList<AnalysisConfiguration> enabledOptions, AnalysisMethodEnum analysisMethod)
          Recursively retrieves all those enabled analysis options that require the given type of analysis method to be performed.
 java.lang.String getName()
          Gets the name attribute, which represents the name of this analysis aspect.
 int getNumberOfChildNodes()
          Traverses the configuration option hierarchy in order to determine the number of all subordinate child nodes (including leaf nodes).
 javax.swing.JPanel getOptionsPanel(javax.swing.JPanel optionsPanel, int currentLevel, int currentRow, int totalDepth)
          Adds GUI elements to the given panel that reflect the structure of this configuration object.
 java.util.Set<AnalysisResult> getResultObjects()
          Gets the results needed to initialize the GUI for this top level category.
 javax.swing.JPanel getResultPanel()
          Sets the actual result contents of the panel representing the belonging kind of analysis perspective (only used for man categories, that is, top-level objects in the tree).
 java.lang.String getToolTip()
          Gets the tool tip attribute, which serves as a tool tip for the corresponding item in the results window.
 int getTreeDepth(int currentLevel, int currentMaxDepth)
          Traverses the configuration option hierarchy in order to obtain the maximum number of levels in the tree.
 boolean hasRegisteredFor(AnalysisMethodEnum methodEnum)
          Determines whether this category has been registered to be provided with the results for the given analysis method.
 boolean isSelected()
          Gets the current selection status of this analysis option.
 void setDescription(java.lang.String description)
          Sets the description attribute, which should contain sufficient information about this analysis option that the user is able to choose for it or not.
 void setName(java.lang.String name)
          Sets the name attribute, which represents the name of this analysis aspect.
 void setNewAnalysisMethod(AnalysisMethodEnum analysisMethod)
          Adds the analysis method attribute, which indicates which kind of technique must be used in order to make use of this analysis option.
 void setResultPanel(AnalysisGUI panel)
          Assigns the GUI containing the results for that main analysis category.
 void setToolTip(java.lang.String toolTip)
          Sets the tool tip attribute, which serves as a tool tip for the corresponding item in the results window.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalysisConfiguration

public AnalysisConfiguration()
Default constructor.

Method Detail

addAnalysisResult

public void addAnalysisResult(AnalysisResult result)
Adds another result object to the list of analysis results held by this category. This only used for top level categories as they get a seperate tab in the results frame, and need to initialize their GUI classes with the analysis results obtained.

Parameters:
result - the new result object

getResultObjects

public java.util.Set<AnalysisResult> getResultObjects()
Gets the results needed to initialize the GUI for this top level category.

Returns:
a list of AnalysisResult objects

getChildrenResultObjects

public java.util.Set<AnalysisResult> getChildrenResultObjects()
Gets the results of the child configurations.

Returns:
the set of analysis result objects

addRequestedMethod

public void addRequestedMethod(AnalysisMethodEnum methodEnum)
Registers this top level category to be provided by the results from the specified analysis method. Synchronized access guaranteed as each AnalysisMethod is executed in a seperate thread and their CustomSwingworker asks for registered configuration objects in order to add the respective AnalysisResult object.

Parameters:
methodEnum - the AnalysisMethodEnum of the analysis method to register for
See Also:
hasRegisteredFor(org.processmining.framework.models.petrinet.algorithms.logReplay.AnalysisMethodEnum)

hasRegisteredFor

public boolean hasRegisteredFor(AnalysisMethodEnum methodEnum)
Determines whether this category has been registered to be provided with the results for the given analysis method. Synchronized access guaranteed as each AnalysisMethod is executed in a seperate thread and their CustomSwingworker asks for registered configuration objects in order to add the respective AnalysisResult object.

Parameters:
methodEnum - the identifier of the analysis method
Returns:
true if the results of this method have been requested, false otherwise
See Also:
addRequestedMethod(org.processmining.framework.models.petrinet.algorithms.logReplay.AnalysisMethodEnum)

addChildConfiguration

public void addChildConfiguration(AnalysisConfiguration newChild)
Adds a new analysis option as a sub category of this kind of analysis.

Parameters:
newChild - the new sub-ordinate analysis option

getEnabledOptionsForAnalysisMethod

public java.util.ArrayList<AnalysisConfiguration> getEnabledOptionsForAnalysisMethod(java.util.ArrayList<AnalysisConfiguration> enabledOptions,
                                                                                     AnalysisMethodEnum analysisMethod)
Recursively retrieves all those enabled analysis options that require the given type of analysis method to be performed.

Parameters:
enabledOptions - the list of the enabled options found for that analysis method so far
analysisMethod - the type of analysis method for which the list of enabled options is requested
Returns:
ArrayList the extended list, containing all the enabled child options which require that analysis method

getTreeDepth

public int getTreeDepth(int currentLevel,
                        int currentMaxDepth)
Traverses the configuration option hierarchy in order to obtain the maximum number of levels in the tree.

Parameters:
currentLevel - indicates the current level of traversal (initially 0 should be passed)
currentMaxDepth - indicates the maximum depth so far encountered in the recursive process
Returns:
0 if there is no element below this one, 1 if there are subordinate elements that do not have children, 2 if at least one of the subordinates has another child element which does not have any children, ...

getNumberOfChildNodes

public int getNumberOfChildNodes()
Traverses the configuration option hierarchy in order to determine the number of all subordinate child nodes (including leaf nodes).

Returns:
the total amount of (direct and indirect) child nodes

getOptionsPanel

public javax.swing.JPanel getOptionsPanel(javax.swing.JPanel optionsPanel,
                                          int currentLevel,
                                          int currentRow,
                                          int totalDepth)
Adds GUI elements to the given panel that reflect the structure of this configuration object.

Parameters:
optionsPanel - the JPanel that should be filled with GUI elements
currentLevel - the current hierarchical level (initially 0 should be passed)
currentRow - the options row in the panel to be written (initially 0 should be passed)
totalDepth - the total depth of the configuration option hierarchy (getTreeDepth can be used to obtain this value)
Returns:
the resulting JPanel component

getChildConfigurations

public java.util.ArrayList<AnalysisConfiguration> getChildConfigurations()
Gets the list of subordinate analysis configuration options. Note that only the adjacent level of subordineates is returned.

Returns:
the list of child objects

isSelected

public boolean isSelected()
Gets the current selection status of this analysis option. Note that the default value is true but that this attribute is held persistent via the configuration manager.

Returns:
true if currently selected, false otherwise
See Also:
#isEnabled

getName

public java.lang.String getName()
Gets the name attribute, which represents the name of this analysis aspect. Furthermore it serves as the label for the corresponding item in the settings window and the result window.

Returns:
the String containing the name of this kind of analysis option

setName

public void setName(java.lang.String name)
Sets the name attribute, which represents the name of this analysis aspect. Furthermore it serves as the label for the corresponding item in the settings window and the result window.

Parameters:
name - the String containing the name of this kind of analysis option

getToolTip

public java.lang.String getToolTip()
Gets the tool tip attribute, which serves as a tool tip for the corresponding item in the results window.

Returns:
the String containing a brief description of this kind of analysis option

setToolTip

public void setToolTip(java.lang.String toolTip)
Sets the tool tip attribute, which serves as a tool tip for the corresponding item in the results window.

Parameters:
toolTip - the String containing a brief description of this kind of analysis option

getResultPanel

public javax.swing.JPanel getResultPanel()
Sets the actual result contents of the panel representing the belonging kind of analysis perspective (only used for man categories, that is, top-level objects in the tree). It serves as an intermediate storage to be packed genericly in the AnalysisResults class.

Returns:
the result panel if assigned before, an empty JPanel otherwise
See Also:
setResultPanel(org.processmining.framework.models.petrinet.algorithms.logReplay.AnalysisGUI)

setResultPanel

public void setResultPanel(AnalysisGUI panel)
Assigns the GUI containing the results for that main analysis category. It serves as an intermediate storage to be packed genericly in the AnalysisResults class.

Parameters:
panel - the results panel

getDescription

public java.lang.String getDescription()
Gets the description attribute, which should contain sufficient information about this analysis option that the user is able to choose for it or not.

Returns:
the String describing this kind of analysis option

setDescription

public void setDescription(java.lang.String description)
Sets the description attribute, which should contain sufficient information about this analysis option that the user is able to choose for it or not.

Parameters:
description - the String describing this kind of analysis option

getAnalysisMethods

public java.util.HashSet<AnalysisMethodEnum> getAnalysisMethods()
Gets the analysis method attributes, which indicates which kind of technique must be used in order to make use of this analysis option. Note that this may be null for configuration objects not representing a concrete metric.

Returns:
the belonging analysis methods

setNewAnalysisMethod

public void setNewAnalysisMethod(AnalysisMethodEnum analysisMethod)
Adds the analysis method attribute, which indicates which kind of technique must be used in order to make use of this analysis option. Note that this may be null for configuration objects not representing a concrete metric.

Parameters:
analysisMethod - the belonging analysis method

findNode

public AnalysisConfiguration findNode(java.lang.String name)
Finds the first node in the configuration tree that has the given name.

Parameters:
name - the name of the node to be found
Returns:
the node if found, false otherwise

clone

public java.lang.Object clone()
Makes a deep copy of this object. Gets, for example, invoked on the current hierarchical analysisOptions object before the analysis is started in order to avoid side effects when spawning multiple result frames from the same settings frame.
Note that the result objects are not cloned (but thrown away) as the clone method is intended to be used before invoking the actual analysis. Note further that the GUI-related members neither are cloned as they are not needed in the analysis stage anymore. Overrides clone.

Overrides:
clone in class java.lang.Object
Returns:
the cloned object