Class DPImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.similarity.nest.sequence.utils.impl.DPImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanalgorithmFinishedDepicts whether the algorithm has finished and a similarity and alignment has been found.protected MatrixPathalignmentPathThe alignment path found by the dp algorithm.protected DataObject[]caseObjectsQuery and case resources as ordered arrays.protected SMCollectiondataCollectionMeasureSimilarity measure to be used for comparing sets of data nodes.protected StringdataSimilarityToUseName of the similarity measure to use for comparing data nodes.protected doublehalvingDistancePercentageThe halving distance to be used by this dp approach.protected doubleinputDataSimWeightWeight for similarity of input data nodes when calculating local node similarity.protected StringlocalSimilarityToUseName of the similarity measure to use for comparing objects locally.protected booleanmatrixIsConstructedDepicts whether scoringMatrix is filled with values.protected doubleoutputDataSimWeightWeight for similarity of output data nodes when calculating local node similarity.protected DataObject[]queryObjectsQuery and case resources as ordered arrays.protected ScoringMatrixscoringMatrix2D scoring matrix constructed by the dp algorithm.protected doublesimilarityValueThe found similarity by the algorithm.protected SimilarityValuatorsimValuatorThe Similarity Valuator to use for the local similarities.protected booleanstartAlignmentInLastRowDepicts whether to bind alignemtn to last row of matrix (and thereby to last query task).protected doubletaskSimWeightWeight for task similarity when calculating local node similarity.
-
Constructor Summary
Constructors Constructor Description DPImpl(DataObject[] queryRes)DPImpl(DataObject[] queryRes, DataObject[] caseRes)DPImpl(NESTSequentialWorkflowObject queryRes)DPImpl(NESTSequentialWorkflowObject queryRes, NESTSequentialWorkflowObject caseRes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomputeSimilarity()Compute the similarity by performing dp.voidcomputeSimilarity(DataObject[] newCaseObjects)Compute the similarity by performing dp on the initial query tasks and new case tasks.voidcomputeSimilarity(NESTSequentialWorkflowObject newCaseRes)Compute the similarity by performing dp on the initial query tasks and new case tasks.MatrixPathgetAssignments()Returns the found assignments of the dp algorithm.protected doublegetLocalNodeSim(DataObject queryObj, DataObject caseObj)Computes the local node similarity which takes dataflow into account when NESTTasks are compared.doublegetRawSimilarityScore()Return the found raw similarity.DataObjectgetRecommendation()Get the recommendation resulting from the found alignment.protected voidinitialize(DataObject[] queryObjects, DataObject[] caseObjects)protected booleanisTwoByTwoMatrix(MatrixPath.MatrixCellPair leftPair, MatrixPath.MatrixCellPair topLeftPair, MatrixPath.MatrixCellPair topPair)Check if parameters build a two by two matrix.voidremoveCase()Remove the curernt case.voidsetBindToLastRow(boolean b)Specify whether to bind alignment to last row of matrix.voidsetCase(DataObject[] caseObjects)Set a new case to be compared to the query.voidsetCase(NESTSequentialWorkflowObject caseRes)Set a new case to be compared to the query.voidsetDataSimilarityToUse(String name)Set the similarity measure to be used for data nodes during local node sim calc.voidsetHalvingDistancePercentage(double halvingDistancePercentage)Set the desired halving distance in percentage of the entire query task length.voidsetLocalSimilarityToUse(String name)Set the similarity measure to be used for task nodes during local node sim calc.voidsetLocalSimWeights(double taskSimWeight, double inputDataSimWeight, double outputDataSimWeight)Set the desired weight distribution for calculation of local node similarities.voidsetSimilarityValuator(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 Detail
-
queryObjects
protected DataObject[] queryObjects
Query and case resources as ordered arrays.
-
caseObjects
protected DataObject[] caseObjects
Query and case resources as ordered arrays.
-
scoringMatrix
protected ScoringMatrix scoringMatrix
2D scoring matrix constructed by the dp algorithm.
-
alignmentPath
protected MatrixPath alignmentPath
The alignment path found by the dp algorithm.
-
matrixIsConstructed
protected boolean matrixIsConstructed
Depicts whether scoringMatrix is filled with values.
-
algorithmFinished
protected boolean algorithmFinished
Depicts whether the algorithm has finished and a similarity and alignment has been found.
-
simValuator
protected SimilarityValuator simValuator
The Similarity Valuator to use for the local similarities.
-
halvingDistancePercentage
protected double halvingDistancePercentage
The halving distance to be used by this dp approach.
-
startAlignmentInLastRow
protected boolean startAlignmentInLastRow
Depicts whether to bind alignemtn to last row of matrix (and thereby to last query task). Defaults to true.
-
inputDataSimWeight
protected double inputDataSimWeight
Weight for similarity of input data nodes when calculating local node similarity.
-
outputDataSimWeight
protected double outputDataSimWeight
Weight for similarity of output data nodes when calculating local node similarity.
-
taskSimWeight
protected double taskSimWeight
Weight for task similarity when calculating local node similarity.
-
similarityValue
protected double similarityValue
The found similarity by the algorithm.
-
dataSimilarityToUse
protected String dataSimilarityToUse
Name of the similarity measure to use for comparing data nodes.
-
localSimilarityToUse
protected String localSimilarityToUse
Name of the similarity measure to use for comparing objects locally.
-
dataCollectionMeasure
protected SMCollection dataCollectionMeasure
Similarity measure to be used for comparing sets of data nodes.
-
-
Constructor Detail
-
DPImpl
public DPImpl(NESTSequentialWorkflowObject queryRes, NESTSequentialWorkflowObject caseRes)
-
DPImpl
public DPImpl(DataObject[] queryRes, DataObject[] caseRes)
-
DPImpl
public DPImpl(NESTSequentialWorkflowObject queryRes)
-
DPImpl
public DPImpl(DataObject[] queryRes)
-
-
Method Detail
-
initialize
protected void initialize(DataObject[] queryObjects, DataObject[] caseObjects)
-
computeSimilarity
public void computeSimilarity()
Description copied from interface:DPCompute the similarity by performing dp.- Specified by:
computeSimilarityin interfaceDP
-
removeCase
public void removeCase()
Description copied from interface:DPRemove the curernt case.- Specified by:
removeCasein interfaceDP
-
getLocalNodeSim
protected double getLocalNodeSim(DataObject queryObj, DataObject caseObj)
Computes the local node similarity which takes dataflow into account when NESTTasks are compared.- Returns:
- A similarity value between 0 and 1.
-
getAssignments
public MatrixPath getAssignments()
Description copied from interface:DPReturns the found assignments of the dp algorithm.- Specified by:
getAssignmentsin interfaceDP- Returns:
- The found assignments of the dp algorithm.
-
getRecommendation
public DataObject getRecommendation()
Description copied from interface:DPGet the recommendation resulting from the found alignment.- Specified by:
getRecommendationin interfaceDP- Returns:
- The data object to recommend.
-
setCase
public void setCase(DataObject[] caseObjects)
Description copied from interface:DPSet a new case to be compared to the query.
-
setCase
public void setCase(NESTSequentialWorkflowObject caseRes)
Description copied from interface:DPSet a new case to be compared to the query.
-
computeSimilarity
public void computeSimilarity(DataObject[] newCaseObjects)
Description copied from interface:DPCompute the similarity by performing dp on the initial query tasks and new case tasks.- Specified by:
computeSimilarityin interfaceDP- Parameters:
newCaseObjects- The new case resource to compare the query to.
-
computeSimilarity
public void computeSimilarity(NESTSequentialWorkflowObject newCaseRes)
Description copied from interface:DPCompute the similarity by performing dp on the initial query tasks and new case tasks.- Specified by:
computeSimilarityin interfaceDP- Parameters:
newCaseRes- The new case resource to compare the query to.
-
getRawSimilarityScore
public double getRawSimilarityScore()
Description copied from interface:DPReturn the found raw similarity.- Specified by:
getRawSimilarityScorein interfaceDP- Returns:
- The raw similarity score.
-
setSimilarityValuator
public void setSimilarityValuator(SimilarityValuator simValuator)
Description copied from interface:DPSet a similarity valuator to be used to calculate the local values.- Specified by:
setSimilarityValuatorin interfaceDP
-
setHalvingDistancePercentage
public void setHalvingDistancePercentage(double halvingDistancePercentage)
Description copied from interface:DPSet the desired halving distance in percentage of the entire query task length.- Specified by:
setHalvingDistancePercentagein interfaceDP
-
setBindToLastRow
public void setBindToLastRow(boolean b)
Description copied from interface:DPSpecify whether to bind alignment to last row of matrix.- Specified by:
setBindToLastRowin interfaceDP- Parameters:
b- true or false.
-
setLocalSimWeights
public void setLocalSimWeights(double taskSimWeight, double inputDataSimWeight, double outputDataSimWeight)Description copied from interface:DPSet 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:
setLocalSimWeightsin interfaceDP
-
setDataSimilarityToUse
public void setDataSimilarityToUse(String name)
Description copied from interface:DPSet 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:
setDataSimilarityToUsein interfaceDP- Parameters:
name- Name of the measure.
-
setLocalSimilarityToUse
public void setLocalSimilarityToUse(String name)
Description copied from interface:DPSet the similarity measure to be used for task nodes during local node sim calc.- Specified by:
setLocalSimilarityToUsein 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:
-
-