Skip to content

Commit 413ed90

Browse files
committed
updating README
1 parent 6733add commit 413ed90

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

README.Rmd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,13 @@ rules <- validator( rule1 = x > 0
6161
is_infeasible(rules)
6262
6363
detect_infeasible_rules(rules, verbose=TRUE)
64-
make_feasible(rules, verbose=TRUE)
65-
6664
# find out the conflict with this rule
6765
is_contradicted_by(rules, "rule1", verbose=TRUE)
66+
67+
# we prefer to keep rule1, so we can give rule1 Inf weight
68+
detect_infeasible_rules(rules, weight=c(rule1 = Inf), verbose=TRUE)
69+
make_feasible(rules, weight=c(rule1=Inf), verbose=TRUE)
70+
6871
```
6972

7073
### Finding contradicting if rules

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,26 @@ detect_infeasible_rules(rules, verbose=TRUE)
6262
#> Found:
6363
#> rule1: x > 0
6464
#> [1] "rule1"
65-
make_feasible(rules, verbose=TRUE)
66-
#> Found:
67-
#> rule1: x > 0
68-
#> Dropping rule(s): "rule1"
69-
#> Object of class 'validator' with 1 elements:
70-
#> rule2: x < 0
71-
#> Rules are evaluated using locally defined options
72-
7365
# find out the conflict with this rule
7466
is_contradicted_by(rules, "rule1", verbose=TRUE)
7567
#> Rule(s):
7668
#> rule1: x > 0
7769
#> contradicted by:
7870
#> rule2: x < 0
7971
#> [1] "rule2"
72+
73+
# we prefer to keep rule1, so we can give rule1 Inf weight
74+
detect_infeasible_rules(rules, weight=c(rule1 = Inf), verbose=TRUE)
75+
#> Found:
76+
#> rule2: x < 0
77+
#> [1] "rule2"
78+
make_feasible(rules, weight=c(rule1=Inf), verbose=TRUE)
79+
#> Found:
80+
#> rule2: x < 0
81+
#> Dropping rule(s): "rule2"
82+
#> Object of class 'validator' with 1 elements:
83+
#> rule1: x > 0
84+
#> Rules are evaluated using locally defined options
8085
```
8186

8287
### Finding contradicting if rules

0 commit comments

Comments
 (0)