Class RpclMeReasoner
- java.lang.Object
-
- net.sf.tweety.logics.rpcl.reasoner.RpclMeReasoner
-
- All Implemented Interfaces:
ModelProvider<RelationalProbabilisticConditional,RpclBeliefSet,RpclProbabilityDistribution<?>>,QuantitativeReasoner<RpclBeliefSet,FolFormula>,Reasoner<java.lang.Double,RpclBeliefSet,FolFormula>
public class RpclMeReasoner extends java.lang.Object implements QuantitativeReasoner<RpclBeliefSet,FolFormula>, ModelProvider<RelationalProbabilisticConditional,RpclBeliefSet,RpclProbabilityDistribution<?>>
General ME-reasoner for RPCL.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description private intinferenceTypeWhether this reasoner should use lifted inference for reasoning.static intLIFTED_INFERENCEInteger constant for lifted inference.private static org.slf4j.LoggerlogLogger.private RpclSemanticssemanticsThe semantics used for this reasoner.static intSTANDARD_INFERENCEInteger constant for standard inference.
-
Constructor Summary
Constructors Constructor Description RpclMeReasoner(RpclSemantics semantics)Creates a new reasoner.RpclMeReasoner(RpclSemantics semantics, int inferenceType)Creates a new reasoner.
-
Method Summary
Modifier and Type Method Description intgetInferenceType()Returns the inference type of this reasoner, i.e.RpclProbabilityDistribution<?>getModel(RpclBeliefSet bbase)Returns a single (dedicated) model of the given belief base.RpclProbabilityDistribution<?>getModel(RpclBeliefSet kb, FolSignature signature)Determines the ME distribution of the given knowlege base wrt.java.util.Collection<RpclProbabilityDistribution<?>>getModels(RpclBeliefSet bbase)Returns a characterizing model of the given belief basejava.lang.Doublequery(RpclBeliefSet beliefbase, FolFormula formula)Queries the given belief base for the given formula.java.lang.Doublequery(RpclBeliefSet beliefbase, FolFormula query, FolSignature signature)Queries the knowledge base wrt.
-
-
-
Field Detail
-
log
private static org.slf4j.Logger log
Logger.
-
STANDARD_INFERENCE
public static final int STANDARD_INFERENCE
Integer constant for standard inference.- See Also:
- Constant Field Values
-
LIFTED_INFERENCE
public static final int LIFTED_INFERENCE
Integer constant for lifted inference.- See Also:
- Constant Field Values
-
semantics
private RpclSemantics semantics
The semantics used for this reasoner.
-
inferenceType
private int inferenceType
Whether this reasoner should use lifted inference for reasoning.
-
-
Constructor Detail
-
RpclMeReasoner
public RpclMeReasoner(RpclSemantics semantics, int inferenceType)
Creates a new reasoner.- Parameters:
semantics- the semantics for this reasoner.inferenceType- one of RpclMeReasoner.STANDARD_INFERENCE or RpclMeReasoner.LIFTED_INFERENCE
-
RpclMeReasoner
public RpclMeReasoner(RpclSemantics semantics)
Creates a new reasoner.- Parameters:
semantics- the semantics for this reasoner.
-
-
Method Detail
-
getInferenceType
public int getInferenceType()
Returns the inference type of this reasoner, i.e. one of RpclMeReasoner.STANDARD_INFERENCE or RpclMeReasoner.LIFTED_INFERENCE- Returns:
- the inference type of this reasoner.
-
query
public java.lang.Double query(RpclBeliefSet beliefbase, FolFormula query, FolSignature signature)
Queries the knowledge base wrt. the given signature.- Parameters:
beliefbase- some knowledge basequery- some querysignature- some signature.- Returns:
- the answer to the query
-
query
public java.lang.Double query(RpclBeliefSet beliefbase, FolFormula formula)
Description copied from interface:ReasonerQueries the given belief base for the given formula.- Specified by:
queryin interfaceReasoner<java.lang.Double,RpclBeliefSet,FolFormula>- Parameters:
beliefbase- a belief baseformula- a formula- Returns:
- the answer to the query
-
getModels
public java.util.Collection<RpclProbabilityDistribution<?>> getModels(RpclBeliefSet bbase)
Description copied from interface:ModelProviderReturns a characterizing model of the given belief base- Specified by:
getModelsin interfaceModelProvider<RelationalProbabilisticConditional,RpclBeliefSet,RpclProbabilityDistribution<?>>- Parameters:
bbase- some belief base- Returns:
- the (selected) models of the belief base
-
getModel
public RpclProbabilityDistribution<?> getModel(RpclBeliefSet bbase)
Description copied from interface:ModelProviderReturns a single (dedicated) model of the given belief base. If the implemented method allows for more than one dedicated model, the selection may be non-deterministic.- Specified by:
getModelin interfaceModelProvider<RelationalProbabilisticConditional,RpclBeliefSet,RpclProbabilityDistribution<?>>- Parameters:
bbase- some belief base- Returns:
- a selected model of the belief base.
-
getModel
public RpclProbabilityDistribution<?> getModel(RpclBeliefSet kb, FolSignature signature)
Determines the ME distribution of the given knowlege base wrt. the given signature.- Parameters:
kb- an RPCL knowledge basesignature- some signature- Returns:
- the ME distribution of the knowledge base
-
-