Modifier and Type | Field and Description |
---|---|
private RuleFilter |
cond
The filter that decides which sub-feature is to be evaluated
|
private Feature |
elseFeature
The feature for negative results of
filter |
private Feature |
thenFeature
The feature for positive results of
filter |
Modifier | Constructor and Description |
---|---|
private |
ConditionalFeature(RuleFilter p_cond,
Feature p_thenFeature,
Feature p_elseFeature) |
Modifier and Type | Method and Description |
---|---|
RuleAppCost |
computeCost(RuleApp app,
PosInOccurrence pos,
Goal goal)
Evaluate the cost of a
RuleApp . |
static Feature |
createConditional(RuleFilter cond,
Feature thenFeature) |
static Feature |
createConditional(RuleFilter cond,
Feature thenFeature,
Feature elseFeature) |
static Feature |
createConditional(RuleFilter cond,
Feature thenFeature,
RuleAppCost elseValue) |
static Feature |
createConditional(RuleFilter cond,
RuleAppCost thenValue) |
static Feature |
createConditional(RuleFilter cond,
RuleAppCost thenValue,
RuleAppCost elseValue) |
private final RuleFilter cond
private final Feature thenFeature
filter
private final Feature elseFeature
filter
private ConditionalFeature(RuleFilter p_cond, Feature p_thenFeature, Feature p_elseFeature)
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).public static Feature createConditional(RuleFilter cond, RuleAppCost thenValue)
cond
- the filter that decides which value is to be returnedthenValue
- the value of the feature, if filter
returns truepublic static Feature createConditional(RuleFilter cond, RuleAppCost thenValue, RuleAppCost elseValue)
cond
- the filter that decides which value is to be returnedthenValue
- the value of the feature, if filter
returns trueelseValue
- the value of the feature, if filter
returns falsepublic static Feature createConditional(RuleFilter cond, Feature thenFeature)
cond
- the filter that decides which value is to be returnedthenFeature
- the feature that is evaluted, if filter
returns true
returns falsepublic static Feature createConditional(RuleFilter cond, Feature thenFeature, RuleAppCost elseValue)
cond
- the filter that decides which value is to be returnedthenFeature
- the feature that is evaluted, if filter
returns trueelseValue
- the value of the feature, if filter
returns falsepublic static Feature createConditional(RuleFilter cond, Feature thenFeature, Feature elseFeature)
cond
- the filter that decides which value is to be returnedthenFeature
- the feature that is evaluted, if filter
returns trueelseFeature
- the feature that is evaluted, if filter
returns false