java.lang.Object
de.uni_trier.wi2.procake.similarity.nest.sequence.utils.impl.DPImpl
All Implemented Interfaces:
DP
Direct Known Subclasses:
DTWImpl, SWAImpl

public abstract class DPImpl extends Object implements DP
  • Field Details

    • 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 Details

  • Method Details

    • initialize

      protected void initialize(DataObject[] queryObjects, DataObject[] caseObjects)
    • computeSimilarity

      public void computeSimilarity()
      Description copied from interface: DP
      Compute the similarity by performing dp.
      Specified by:
      computeSimilarity in interface DP
    • removeCase

      public void removeCase()
      Description copied from interface: DP
      Remove the curernt case.
      Specified by:
      removeCase in interface DP
    • 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: DP
      Returns the found assignments of the dp algorithm.
      Specified by:
      getAssignments in interface DP
      Returns:
      The found assignments of the dp algorithm.
    • getRecommendation

      public DataObject getRecommendation()
      Description copied from interface: DP
      Get the recommendation resulting from the found alignment.
      Specified by:
      getRecommendation in interface DP
      Returns:
      The data object to recommend.
    • setCase

      public void setCase(DataObject[] caseObjects)
      Description copied from interface: DP
      Set a new case to be compared to the query.
      Specified by:
      setCase in interface DP
      Parameters:
      caseObjects - The new de facto instance.
    • setCase

      public void setCase(NESTSequentialWorkflowObject caseRes)
      Description copied from interface: DP
      Set a new case to be compared to the query.
      Specified by:
      setCase in interface DP
      Parameters:
      caseRes - The new de facto instance.
    • computeSimilarity

      public void computeSimilarity(DataObject[] newCaseObjects)
      Description copied from interface: DP
      Compute the similarity by performing dp on the initial query tasks and new case tasks.
      Specified by:
      computeSimilarity in interface DP
      Parameters:
      newCaseObjects - The new case resource to compare the query to.
    • computeSimilarity

      public void computeSimilarity(NESTSequentialWorkflowObject newCaseRes)
      Description copied from interface: DP
      Compute the similarity by performing dp on the initial query tasks and new case tasks.
      Specified by:
      computeSimilarity in interface DP
      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 interface DP
      Returns:
      The raw similarity score.
    • setSimilarityValuator

      public void setSimilarityValuator(SimilarityValuator simValuator)
      Description copied from interface: DP
      Set a similarity valuator to be used to calculate the local values.
      Specified by:
      setSimilarityValuator in interface DP
    • 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 interface DP
    • 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 interface DP
      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 interface DP
    • setDataSimilarityToUse

      public void setDataSimilarityToUse(String name)
      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 interface DP
      Parameters:
      name - Name of the measure.
    • setLocalSimilarityToUse

      public void setLocalSimilarityToUse(String name)
      Description copied from interface: DP
      Set the similarity measure to be used for task nodes during local node sim calc.
      Specified by:
      setLocalSimilarityToUse in interface DP
      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: