Interface CostModel<D>
-
- Type Parameters:
D- type of node data on which the cost model is defined.
- All Known Implementing Classes:
PerEditOperationStringNodeDataCostModel,StringUnitCostModel
public interface CostModel<D>This interface specifies the methods to implement for a custom cost model. The methods represent the costs of edit operations (delete, insert, rename).If the cost function is a metric, the tree edit distance is a metric too.
However, the cost function does not have to be a metric - the costs of deletion, insertion and rename can be arbitrary.
IMPORTANT: Mind the float type use for costs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description floatdel(AptedNode<D> n)Calculates the cost of deleting a node.floatins(AptedNode<D> n)Calculates the cost of inserting a node.floatren(AptedNode<D> n1, AptedNode<D> n2)Calculates the cost of renaming (mapping) two nodes.
-
-
-
Method Detail
-
del
float del(AptedNode<D> n)
Calculates the cost of deleting a node.- Parameters:
n- the node considered to be deleted.- Returns:
- the cost of deleting node n.
-
ins
float ins(AptedNode<D> n)
Calculates the cost of inserting a node.- Parameters:
n- the node considered to be inserted.- Returns:
- the cost of inserting node n.
-
-