Interface GraphOfFORuleDependencies
- All Known Implementing Classes:
GRDImpl
public interface GraphOfFORuleDependencies
A graph of rule dependencies represent the possibility that an application of a rule triggers the linked rules in the graph.
- Author:
- Florent Tornil
-
Method Summary
Modifier and TypeMethodDescriptiongetAncestorRules(FORule target) Returns all rules that can trigger the specified one.Collection<? extends FORule> getAncestorRules(FORule rule, Set<FORule> rulesToIgnore) Retrieves the ancestor rules by ignoring some rulesThe computed order of the stratification must guaranty a correct rule application but no additional assumption is done at this level on the computed stratumgetCompressedAncestorRules(FORule target) Returns the compressed ancestor rules of the specified rule.The computed order of the stratification must guaranty a correct rule application.getPreventedRules(FORule src) Returns all rules that can be prevented by the specified one.getRules()Return all the rules in the GRDComputes a stratification of the rules for single evaluation.getTriggeredRules(FORule src) Returns all rules that can be triggered by the specified one.booleanCheck if this GRD is stratifiable
-
Method Details
-
getRules
-
getTriggeredRules
-
getAncestorRules
-
getCompressedAncestorRules
-
getPreventedRules
-
isStratifiable
boolean isStratifiable()Check if this GRD is stratifiable- Returns:
- true iff the ruleset represented by this GRD is stratifiable
-
getBySccStratification
-
getMinimalStratification
The computed order of the stratification must guaranty a correct rule application. This method should try to minimize the number of stratum while keeping a correct order but no guaranty is given on the minimality of the result. An empty optional should be returned if the rules are not stratifiable- Returns:
- the stratification as an ordered list of rulebases
-
getSingleEvaluationStratification
Computes a stratification of the rules for single evaluation. This method ensures that each rule is evaluated exactly once and attempts to minimize the number of strata. This is only possible for an acyclic graph; if the graph contains a cycle, an empty Optional is returned.- Returns:
- an Optional containing the stratification as an ordered list of rule bases if the graph is acyclic, otherwise an empty Optional.
-
getAncestorRules
Retrieves the ancestor rules by ignoring some rules- Parameters:
rule- the rule whose ancestors are requestedrulesToIgnore- these rules will be ignored in the recursive search of ancestors- Returns:
- the ancestor rules found while ignoring the supplied rules
-