public class RuleBasedCReasoner extends Reasoner
Modifier and Type | Class and Description |
---|---|
static interface |
RuleBasedCReasoner.Rule
A rule that is applicable by the
RuleBasedCReasoner to reason a
c-representation given a conditional belief base. |
Modifier and Type | Field and Description |
---|---|
private ClBeliefSet |
beliefBase
the belief base that is reasoned on
|
private ConditionalStructure |
cs
the conditional structure generated by the belief base of this reasoner, is null until prepare() is called.
|
private boolean |
humanFriendly
a flag indicating if a human friend processing shall be used, that means
everything is calculated no fast-evaluation, such that a human can better
follow the algorithm.
|
private java.util.Map<Conditional,KappaValue> |
kappas
the map of conditions to their penalty values (kappa), is null until prepare() is called
|
private RankingFunction |
rfunc
The ranking function representing the c-representation of the given belief base, is null until process() returns true
|
private java.util.List<RuleBasedCReasoner.Rule> |
rules
A prioritized list of rules, the first rule is applied first and so on.
|
Constructor and Description |
---|
RuleBasedCReasoner(ClBeliefSet beliefBase) |
RuleBasedCReasoner(ClBeliefSet beliefBase,
boolean humanFriendly) |
RuleBasedCReasoner(java.util.Collection<Conditional> conditionals) |
RuleBasedCReasoner(java.util.Collection<Conditional> conditionals,
boolean humanFriendly) |
Modifier and Type | Method and Description |
---|---|
ConditionalStructure |
getConditionalStructure() |
java.util.Collection<KappaValue> |
getKappas() |
RankingFunction |
getSemantic() |
boolean |
isComplete()
Checks every kappa value.
|
void |
prepare()
Prepares the data structures:
ConditionalStructure and the list of KappaValue , such
that the rules can be applied on them. |
boolean |
process()
Processes the kappa values using the rules stored in the prioritzed rule list.
|
Answer |
query(Formula query)
This method determines the answer of the given query
wrt.
|
getKnowledgeBase
private ClBeliefSet beliefBase
private ConditionalStructure cs
private java.util.Map<Conditional,KappaValue> kappas
private RankingFunction rfunc
private boolean humanFriendly
private java.util.List<RuleBasedCReasoner.Rule> rules
public RuleBasedCReasoner(java.util.Collection<Conditional> conditionals)
public RuleBasedCReasoner(java.util.Collection<Conditional> conditionals, boolean humanFriendly)
public RuleBasedCReasoner(ClBeliefSet beliefBase)
public RuleBasedCReasoner(ClBeliefSet beliefBase, boolean humanFriendly)
public RankingFunction getSemantic()
public boolean process()
public boolean isComplete()
public void prepare()
ConditionalStructure
and the list of KappaValue
, such
that the rules can be applied on them.public java.util.Collection<KappaValue> getKappas()
public ConditionalStructure getConditionalStructure()