public abstract class BinaryFeature extends java.lang.Object implements Feature
Modifier and Type | Field and Description |
---|---|
static RuleAppCost |
TOP_COST
Constant that represents the boolean value false
|
static RuleAppCost |
ZERO_COST
Constant that represents the boolean value true
|
Modifier | Constructor and Description |
---|---|
protected |
BinaryFeature() |
Modifier and Type | Method and Description |
---|---|
RuleAppCost |
computeCost(RuleApp app,
PosInOccurrence pos,
Goal goal)
Evaluate the cost of a
RuleApp . |
protected abstract boolean |
filter(RuleApp app,
PosInOccurrence pos,
Goal goal)
Compute whether the result of the feature is zero (
true )
or infinity (false ) |
public static final RuleAppCost ZERO_COST
public static final RuleAppCost TOP_COST
public RuleAppCost computeCost(RuleApp app, PosInOccurrence pos, Goal goal)
Feature
RuleApp
.computeCost
in interface Feature
app
- the RuleApppos
- position where app
is to be appliedgoal
- the goal on which app
is to be appliedRuleAppCost
object. TopRuleAppCost.INSTANCE
indicates that the rule shall not be applied at all (it is discarded by
the strategy).protected abstract boolean filter(RuleApp app, PosInOccurrence pos, Goal goal)
true
)
or infinity (false
)app
- the RuleApppos
- position where app
is to be appliedgoal
- the goal on which app
is to be applied