Skip to content

Commit 390c32d

Browse files
committed
Update in preferredAttributesPerRule/preferredConditionsPerRule parameters: the value of 0 interpreted as the infinity.
1 parent 1b3e6a3 commit 390c32d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

adaa.analytics.rules/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ codeQuality {
2727
}
2828

2929
sourceCompatibility = 1.8
30-
version = '1.7.4'
30+
version = '1.7.5'
3131

3232

3333
jar {

adaa.analytics.rules/src/main/java/adaa/analytics/rules/logic/representation/Knowledge.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ public class Knowledge implements Serializable {
138138

139139
/** Gets {@link #preferredConditionsPerRule}. */
140140
public int getPreferredConditionsPerRule() { return preferredConditionsPerRule; }
141-
/** Sets {@link #preferredConditionsPerRule}. */
142-
public void setPreferredConditionsPerRule(int preferredConditionsPerRule) { this.preferredConditionsPerRule = preferredConditionsPerRule; }
141+
/** Sets {@link #preferredConditionsPerRule}. The value of 0 is translated to the infinity.*/
142+
public void setPreferredConditionsPerRule(int v) {
143+
this.preferredConditionsPerRule = (v == 0) ? Integer.MAX_VALUE : v;
144+
}
143145

144146
/** Gets {@link #preferredAttributesPerRule}. */
145147
public int getPreferredAttributesPerRule() { return preferredAttributesPerRule; }
146-
/** Sets {@link #preferredAttributesPerRule}. */
147-
public void setPreferredAttributesPerRule(int preferredAttributesPerRule) { this.preferredAttributesPerRule = preferredAttributesPerRule; }
148+
/** Sets {@link #preferredAttributesPerRule}. The value of 0 is translated to the infinity.*/
149+
public void setPreferredAttributesPerRule(int v) {
150+
this.preferredAttributesPerRule = (v == 0) ? Integer.MAX_VALUE : v;
151+
}
148152

149153
/**
150154
* Initializes knowledge from collections of initial rules, preferred/forbidden conditions and attributes.

0 commit comments

Comments
 (0)