Class StringUnitCostModel

    • Constructor Detail

      • StringUnitCostModel

        public StringUnitCostModel()
    • Method Detail

      • del

        public float del​(AptedNode<StringNodeData> n)
        Calculates the cost of deleting a node.
        Specified by:
        del in interface CostModel<StringNodeData>
        Parameters:
        n - a node considered to be deleted.
        Returns:
        1 - a fixed cost of deleting a node.
      • ins

        public float ins​(AptedNode<StringNodeData> n)
        Calculates the cost of inserting a node.
        Specified by:
        ins in interface CostModel<StringNodeData>
        Parameters:
        n - a node considered to be inserted.
        Returns:
        1 - a fixed cost of inserting a node.
      • ren

        public float ren​(AptedNode<StringNodeData> n1,
                         AptedNode<StringNodeData> n2)
        Calculates the cost of renaming the label of the source node to the label of the destination node.
        Specified by:
        ren in interface CostModel<StringNodeData>
        Parameters:
        n1 - a source node for rename.
        n2 - a destination node for rename.
        Returns:
        1 if labels of renamed nodes are equal, and 0 otherwise.