detect_infeasible_rules {validatetools} | R Documentation |
Detect which rules cause infeasibility
Description
Detect which rules cause infeasibility. This methods tries to remove the minimum number of rules to make the system mathematically feasible. Note that this may not result in your desired system, because some rules may be more important to you than others. This can be mitigated by supplying weights for the rules. Default weight is 1.
Usage
detect_infeasible_rules(x, weight = numeric(), ..., verbose = interactive())
Arguments
x |
|
weight |
optional named |
... |
not used |
verbose |
if |
Value
character
with the names of the rules that are causing infeasibility.
See Also
Other feasibility:
detect_boundary_cat()
,
detect_boundary_num()
,
detect_contradicting_if_rules()
,
is_contradicted_by()
,
is_infeasible()
,
make_feasible()
Examples
rules <- validator( x > 0)
is_infeasible(rules)
# infeasible system!
rules <- validator( rule1 = x > 0
, rule2 = x < 0
)
is_infeasible(rules)
detect_infeasible_rules(rules, verbose=TRUE)
# but we want to keep rule1, so specify that it has an Inf weight
detect_infeasible_rules(rules, weight=c(rule1=Inf), verbose=TRUE)
# detect and remove
make_feasible(rules, weight=c(rule1=Inf), verbose = TRUE)
# find out the conflict with rule2
is_contradicted_by(rules, "rule2", verbose = TRUE)