Class DPImpl
java.lang.Object
de.uni_trier.wi2.procake.similarity.nest.sequence.utils.impl.DPImpl
- All Implemented Interfaces:
DP
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Depicts whether the algorithm has finished and a similarity and alignment has been found.protected MatrixPath
The alignment path found by the dp algorithm.protected DataObject[]
Query and case resources as ordered arrays.protected SMCollection
Similarity measure to be used for comparing sets of data nodes.protected String
Name of the similarity measure to use for comparing data nodes.protected double
The halving distance to be used by this dp approach.protected SMListDP.DIFFERENT_BEGINNINGS_STRATEGIES
protected double
Weight for similarity of input data nodes when calculating local node similarity.protected String
Name of the similarity measure to use for comparing objects locally.protected boolean
Depicts whether scoringMatrix is filled with values.protected double
Weight for similarity of output data nodes when calculating local node similarity.protected DataObject[]
Query and case resources as ordered arrays.protected ScoringMatrix
2D scoring matrix constructed by the dp algorithm.protected double
The found similarity by the algorithm.protected SimilarityValuator
The Similarity Valuator to use for the local similarities.protected boolean
Depicts whether to bind alignemtn to last row of matrix (and thereby to last query task).protected double
Weight for task similarity when calculating local node similarity. -
Constructor Summary
ConstructorDescriptionDPImpl
(DataObject[] queryRes) DPImpl
(DataObject[] queryRes, DataObject[] caseRes, SMListDP.DIFFERENT_BEGINNINGS_STRATEGIES ignoreDifferentBeginnings, String localSimilarityToUse) DPImpl
(NESTSequentialWorkflowObject queryRes) DPImpl
(NESTSequentialWorkflowObject queryRes, NESTSequentialWorkflowObject caseRes, SMListDP.DIFFERENT_BEGINNINGS_STRATEGIES ignoreDifferentBeginnings, String localSimilarityToUse) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Compute the similarity by performing dp.void
computeSimilarity
(DataObject[] newCaseObjects) Compute the similarity by performing dp on the initial query tasks and new case tasks.void
computeSimilarity
(NESTSequentialWorkflowObject newCaseRes) Compute the similarity by performing dp on the initial query tasks and new case tasks.Returns the found assignments of the dp algorithm.protected double
getLocalNodeSim
(DataObject queryObj, DataObject caseObj) Computes the local node similarity which takes dataflow into account when NESTTasks are compared.double
Return the found raw similarity.Get the recommendation resulting from the found alignment.protected void
initialize
(DataObject[] queryObjects, DataObject[] caseObjects) protected boolean
isTwoByTwoMatrix
(MatrixPath.MatrixCellPair leftPair, MatrixPath.MatrixCellPair topLeftPair, MatrixPath.MatrixCellPair topPair) Check if parameters build a two by two matrix.void
Remove the curernt case.void
setBindToLastRow
(boolean b) Specify whether to bind alignment to last row of matrix.void
setCase
(DataObject[] caseObjects) Set a new case to be compared to the query.void
setCase
(NESTSequentialWorkflowObject caseRes) Set a new case to be compared to the query.void
setDataSimilarityToUse
(String name) Set the similarity measure to be used for data nodes during local node sim calc.void
setHalvingDistancePercentage
(double halvingDistancePercentage) Set the desired halving distance in percentage of the entire query task length.void
Set the similarity measure to be used for task nodes during local node sim calc.void
setLocalSimWeights
(double taskSimWeight, double inputDataSimWeight, double outputDataSimWeight) Set the desired weight distribution for calculation of local node similarities.void
setSimilarityValuator
(SimilarityValuator simValuator) Set a similarity valuator to be used to calculate the local values.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.uni_trier.wi2.procake.similarity.nest.sequence.utils.DP
getAlignment, getNormedSimilarityScore, getStepVec
-
Field Details
-
queryObjects
Query and case resources as ordered arrays. -
caseObjects
Query and case resources as ordered arrays. -
scoringMatrix
2D scoring matrix constructed by the dp algorithm. -
alignmentPath
The alignment path found by the dp algorithm. -
matrixIsConstructed
protected boolean matrixIsConstructedDepicts whether scoringMatrix is filled with values. -
algorithmFinished
protected boolean algorithmFinishedDepicts whether the algorithm has finished and a similarity and alignment has been found. -
ignoreDifferentBeginnings
-
simValuator
The Similarity Valuator to use for the local similarities. -
halvingDistancePercentage
protected double halvingDistancePercentageThe halving distance to be used by this dp approach. -
startAlignmentInLastRow
protected boolean startAlignmentInLastRowDepicts whether to bind alignemtn to last row of matrix (and thereby to last query task). Defaults to true. -
inputDataSimWeight
protected double inputDataSimWeightWeight for similarity of input data nodes when calculating local node similarity. -
outputDataSimWeight
protected double outputDataSimWeightWeight for similarity of output data nodes when calculating local node similarity. -
taskSimWeight
protected double taskSimWeightWeight for task similarity when calculating local node similarity. -
similarityValue
protected double similarityValueThe found similarity by the algorithm. -
dataSimilarityToUse
Name of the similarity measure to use for comparing data nodes. -
localSimilarityToUse
Name of the similarity measure to use for comparing objects locally. -
dataCollectionMeasure
Similarity measure to be used for comparing sets of data nodes.
-
-
Constructor Details
-
DPImpl
public DPImpl(NESTSequentialWorkflowObject queryRes, NESTSequentialWorkflowObject caseRes, SMListDP.DIFFERENT_BEGINNINGS_STRATEGIES ignoreDifferentBeginnings, String localSimilarityToUse) -
DPImpl
public DPImpl(DataObject[] queryRes, DataObject[] caseRes, SMListDP.DIFFERENT_BEGINNINGS_STRATEGIES ignoreDifferentBeginnings, String localSimilarityToUse) -
DPImpl
-
DPImpl
-
-
Method Details
-
initialize
-
computeSimilarity
public void computeSimilarity()Description copied from interface:DP
Compute the similarity by performing dp.- Specified by:
computeSimilarity
in interfaceDP
-
removeCase
public void removeCase()Description copied from interface:DP
Remove the curernt case.- Specified by:
removeCase
in interfaceDP
-
getLocalNodeSim
Computes the local node similarity which takes dataflow into account when NESTTasks are compared.- Returns:
- A similarity value between 0 and 1.
-
getAssignments
Description copied from interface:DP
Returns the found assignments of the dp algorithm.- Specified by:
getAssignments
in interfaceDP
- Returns:
- The found assignments of the dp algorithm.
-
getRecommendation
Description copied from interface:DP
Get the recommendation resulting from the found alignment.- Specified by:
getRecommendation
in interfaceDP
- Returns:
- The data object to recommend.
-
setCase
Description copied from interface:DP
Set a new case to be compared to the query. -
setCase
Description copied from interface:DP
Set a new case to be compared to the query. -
computeSimilarity
Description copied from interface:DP
Compute the similarity by performing dp on the initial query tasks and new case tasks.- Specified by:
computeSimilarity
in interfaceDP
- Parameters:
newCaseObjects
- The new case resource to compare the query to.
-
computeSimilarity
Description copied from interface:DP
Compute the similarity by performing dp on the initial query tasks and new case tasks.- Specified by:
computeSimilarity
in interfaceDP
- Parameters:
newCaseRes
- The new case resource to compare the query to.
-
getRawSimilarityScore
public double getRawSimilarityScore()Description copied from interface:DP
Return the found raw similarity.- Specified by:
getRawSimilarityScore
in interfaceDP
- Returns:
- The raw similarity score.
-
setSimilarityValuator
Description copied from interface:DP
Set a similarity valuator to be used to calculate the local values.- Specified by:
setSimilarityValuator
in interfaceDP
-
setHalvingDistancePercentage
public void setHalvingDistancePercentage(double halvingDistancePercentage) Description copied from interface:DP
Set the desired halving distance in percentage of the entire query task length.- Specified by:
setHalvingDistancePercentage
in interfaceDP
-
setBindToLastRow
public void setBindToLastRow(boolean b) Description copied from interface:DP
Specify whether to bind alignment to last row of matrix.- Specified by:
setBindToLastRow
in interfaceDP
- Parameters:
b
- true or false.
-
setLocalSimWeights
public void setLocalSimWeights(double taskSimWeight, double inputDataSimWeight, double outputDataSimWeight) Description copied from interface:DP
Set the desired weight distribution for calculation of local node similarities. Only applies if de facto graphs (or lists of task nodes) are being compared.- Specified by:
setLocalSimWeights
in interfaceDP
-
setDataSimilarityToUse
Description copied from interface:DP
Set the similarity measure to be used for data nodes during local node sim calc. Only applies if de facto graphs (or lists of task nodes) are being compared.- Specified by:
setDataSimilarityToUse
in interfaceDP
- Parameters:
name
- Name of the measure.
-
setLocalSimilarityToUse
Description copied from interface:DP
Set the similarity measure to be used for task nodes during local node sim calc.- Specified by:
setLocalSimilarityToUse
in interfaceDP
- Parameters:
name
- Name of the measure.
-
isTwoByTwoMatrix
protected boolean isTwoByTwoMatrix(MatrixPath.MatrixCellPair leftPair, MatrixPath.MatrixCellPair topLeftPair, MatrixPath.MatrixCellPair topPair) Check if parameters build a two by two matrix.- Parameters:
leftPair
-topLeftPair
-topPair
-- Returns:
-