Package com.helix.core.reorder
Class RatioSortPolicy
java.lang.Object
com.helix.core.reorder.RatioSortPolicy
- All Implemented Interfaces:
ReorderingPolicy
Analytical baseline reordering policy sorting candidate clauses in ascending
order of their cost-to-failure ratio (C_i / F_i).
Clauses with the lowest ratio (fastest to evaluate and most likely to fail) are placed first to maximize short-circuit probability.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecomputeRatio(NodeStats stats) Computes the effective cost-to-failure ratio for a node.determineOrder(List<NodeStats> nodes) Determines the optimal evaluation order of candidate AST clauses.
-
Constructor Details
-
RatioSortPolicy
public RatioSortPolicy()
-
-
Method Details
-
determineOrder
Description copied from interface:ReorderingPolicyDetermines the optimal evaluation order of candidate AST clauses.- Specified by:
determineOrderin interfaceReorderingPolicy- Parameters:
nodes- list of node statistics corresponding to candidate clauses- Returns:
- list of 0-based indices representing the new evaluation sequence
-
computeRatio
Computes the effective cost-to-failure ratio for a node.- Parameters:
stats- node statistics- Returns:
- ratio value
-