Class StringUnitCostModel
- java.lang.Object
-
- com.crawljax.stateabstractions.dom.apted.costmodel.StringUnitCostModel
-
- All Implemented Interfaces:
CostModel<StringNodeData>
public class StringUnitCostModel extends Object implements CostModel<StringNodeData>
This is a unit-nost model defined on string labels.- See Also:
CostModel,StringNodeData
-
-
Constructor Summary
Constructors Constructor Description StringUnitCostModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatdel(AptedNode<StringNodeData> n)Calculates the cost of deleting a node.floatins(AptedNode<StringNodeData> n)Calculates the cost of inserting a node.floatren(AptedNode<StringNodeData> n1, AptedNode<StringNodeData> n2)Calculates the cost of renaming the label of the source node to the label of the destination node.
-
-
-
Method Detail
-
del
public float del(AptedNode<StringNodeData> n)
Calculates the cost of deleting a node.- Specified by:
delin interfaceCostModel<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:
insin interfaceCostModel<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:
renin interfaceCostModel<StringNodeData>- Parameters:
n1- a source node for rename.n2- a destination node for rename.- Returns:
1if labels of renamed nodes are equal, and0otherwise.
-
-