Class PerEditOperationStringNodeDataCostModel
- java.lang.Object
-
- com.crawljax.stateabstractions.dom.apted.costmodel.PerEditOperationStringNodeDataCostModel
-
- All Implemented Interfaces:
CostModel<StringNodeData>
public class PerEditOperationStringNodeDataCostModel extends Object implements CostModel<StringNodeData>
This is a cost model defined onStringNodeDatawith a fixed cost per edit operation.
-
-
Constructor Summary
Constructors Constructor Description PerEditOperationStringNodeDataCostModel(float delCost, float insCost, float renCost)Initialises the cost model with the passed edit operation costs.
-
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 string labels of two nodes.
-
-
-
Constructor Detail
-
PerEditOperationStringNodeDataCostModel
public PerEditOperationStringNodeDataCostModel(float delCost, float insCost, float renCost)Initialises the cost model with the passed edit operation costs.- Parameters:
delCost- deletion cost.insCost- insertion cost.renCost- rename cost.
-
-
Method Detail
-
del
public float del(AptedNode<StringNodeData> n)
Calculates the cost of deleting a node.- Specified by:
delin interfaceCostModel<StringNodeData>- Parameters:
n- the node considered to be deleted.- Returns:
- the cost of deleting node n.
-
ins
public float ins(AptedNode<StringNodeData> n)
Calculates the cost of inserting a node.- Specified by:
insin interfaceCostModel<StringNodeData>- Parameters:
n- the node considered to be inserted.- Returns:
- the cost of inserting node n.
-
ren
public float ren(AptedNode<StringNodeData> n1, AptedNode<StringNodeData> n2)
Calculates the cost of renaming the string labels of two nodes.- Specified by:
renin interfaceCostModel<StringNodeData>- Parameters:
n1- the source node of rename.n2- the destination node of rename.- Returns:
- the cost of renaming node n1 to n2.
-
-