public class TraceAlignment
extends java.lang.Object
The trace alignment step is the second out of four steps performed by this plugin.
It is executed after Consolidation
and before an arbitrary process discovery algorithm, e.g. AlignedStepDiscovery
.
In this class Alignment
s are generated by comparing traces with each other and adding gap-signs to them,
so that they have an equal length and are more similar in eventwise comparison of the traces.
First, traces are compared pairwise, generating alignments of size two. Afterwards they are evaluated by a scoring function and the best alignments are aligned again, evaluated and selected for the next level of hierarchy. This procedure continues until all traces are part of the final alignment. While the subscore- and indelscore-parameters are part of the scoring table building algorithm, which is used to actually do an alignment, the evalscore-parameter determine how it is rated afterwards in order to select the best one. All these parameters can be set by the user.
I reimplemented the algorithm from the (at development date) current version of TraceAlignment in ProM from J. C. Boose, because it was not executable.Constructor and Description |
---|
TraceAlignment() |
Modifier and Type | Method and Description |
---|---|
Alignment |
alignAlignments(Alignment a1,
Alignment a2)
Aligns two alignments by adding gap-signs to their traces.
|
java.util.ArrayList<Alignment> |
findBestAlignsAtCurrentLevel(java.util.ArrayList<Alignment> allAlignmentsAtLvl,
java.util.ArrayList<java.lang.Integer> evalAtLvl,
java.util.ArrayList<Alignment> list,
int lvlCounter)
Select a subset from all potential alignments in the input allAlignmentsAtLvl by considering
their evaluation score results.
|
Alignment |
pairWiseTraceAlignment(org.deckfour.xes.model.XTrace t1,
org.deckfour.xes.model.XTrace t2)
Aligns two traces by adding gap-signs to them.
|
java.lang.Object[] |
recursiveTA(java.util.ArrayList<Alignment> list,
int count)
The recursive main method of this class, which controls the different substeps by invocation of the submethods.
|
void |
transferParameters(int[] alignmentParameter)
In this constructor the scoring parameters are transfered from the user input to the objects datafields,
in order to make the alignment configurable.
|
public void transferParameters(int[] alignmentParameter)
public java.lang.Object[] recursiveTA(java.util.ArrayList<Alignment> list, int count)
list
- - The resulting alignments of the current invocation round (count)count
- - The n-th invocation of the recursive methodpublic Alignment pairWiseTraceAlignment(org.deckfour.xes.model.XTrace t1, org.deckfour.xes.model.XTrace t2)
Aligns two traces by adding gap-signs to them.
First a scoring table (2D-Integer matrix) is build. Each cells value is composed of the value of one of their neighbors(top,diagonal-top-left,left) + a certain function including the users scoring parameters, depending on which value is maximal.
Afterwards the algorithm start at the bottom-right end of the table and checks which of the aforementioned neighbor values is maximal. Depending on this one of three actions is performed: Adding a gap-sign to T1, not adding any gap-sign, or adding one to T2. Then it jumps to this maximal neighbor-value and does the same checking.
The pairwise alignment is done after the algorithm ended in the top-left corner of the table.
public Alignment alignAlignments(Alignment a1, Alignment a2)
Aligns two alignments by adding gap-signs to their traces.
This method is quite similar to the pairwiseTraceAlignment-method, but works withAlignment
s instead of single traces as inputs.
For this purpose it uses its own submethods for scoring.
First a scoring table (2D-Integer matrix) is build. Each cells value is composed of the value of one of their neighbors(top,diagonal-top-left,left) + a certain function including the users scoring parameters, depending on which value is maximal.
Afterwards the algorithm start at the bottom-right end of the table and checks which of the aforementioned neighbor values is maximal. Depending on this one of three actions is performed: Adding a gap-sign to all traces in A1, not adding any gap-sign, or adding a gap-sign to all traces in A2. Then it jumps to this maximal neighbor-value and does the same checking.
The alignment of the input sub-alignments is done after the algorithm ended in the top-left corner of the table.
public java.util.ArrayList<Alignment> findBestAlignsAtCurrentLevel(java.util.ArrayList<Alignment> allAlignmentsAtLvl, java.util.ArrayList<java.lang.Integer> evalAtLvl, java.util.ArrayList<Alignment> list, int lvlCounter)
allAlignmentsAtLvl
- - all POTENTIAL alignments generated in this roundevalAtLvl
- - the evaluation results of the alignmentslist
- - list of all EXISTING alignments in total (generated in previous rounds)lvlCounter
- - the number of rounds