Class ApproximateNaiveMlnReasoner
- java.lang.Object
-
- net.sf.tweety.logics.mln.reasoner.AbstractMlnReasoner
-
- net.sf.tweety.logics.mln.reasoner.ApproximateNaiveMlnReasoner
-
- All Implemented Interfaces:
QuantitativeReasoner<MarkovLogicNetwork,FolFormula>
,Reasoner<java.lang.Double,MarkovLogicNetwork,FolFormula>
public class ApproximateNaiveMlnReasoner extends AbstractMlnReasoner
This reasoner performs approximate reasoning with MLNs by considering only a subset of all Herbrand interpretations. This subset is chosen by first randomly selecting a set of Herbrand interpretations and then selecting the subset of this set with maximum weights.- Author:
- Matthias Thimm
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ApproximateNaiveMlnReasoner.WeightedHerbrandInterpretation
A Herbrand interpretation with an annotated weight.
-
Field Summary
Fields Modifier and Type Field Description private long
maxNumberOfInterpretationsForModel
The maximum number of interpretations used for the model.private long
maxNumberOfSelectedInterpretations
The maximum number of interpretations selected from the whole set of interpretations.
-
Constructor Summary
Constructors Constructor Description ApproximateNaiveMlnReasoner(long maxNumberOfSelectedInterpretations, long maxNumberOfInterpretationsForModel)
Creates a new ApproximateNaiveMlnReasoner.
-
Method Summary
Modifier and Type Method Description java.util.Map<HerbrandInterpretation,java.lang.Double>
computeModel(MarkovLogicNetwork mln, FolSignature signature)
Computes the model of the given MLN wrt.protected double
doQuery(MarkovLogicNetwork mln, FolFormula query, FolSignature signature)
Performs the actual querying.-
Methods inherited from class net.sf.tweety.logics.mln.reasoner.AbstractMlnReasoner
computeWeight, numberOfGroundSatisfactions, query, query
-
-
-
-
Field Detail
-
maxNumberOfSelectedInterpretations
private long maxNumberOfSelectedInterpretations
The maximum number of interpretations selected from the whole set of interpretations. Is -1 if all interpretations are to be selected.
-
maxNumberOfInterpretationsForModel
private long maxNumberOfInterpretationsForModel
The maximum number of interpretations used for the model. Those interpretations are the subset of the interpretations selected with maximum weight. Is -1 if all interpretations are used for the model. It has to be maxNumberOfSelectedInterpretations >= maxNumberOfInterpretationsForModel.
-
-
Constructor Detail
-
ApproximateNaiveMlnReasoner
public ApproximateNaiveMlnReasoner(long maxNumberOfSelectedInterpretations, long maxNumberOfInterpretationsForModel)
Creates a new ApproximateNaiveMlnReasoner.- Parameters:
maxNumberOfSelectedInterpretations
- the maximum number of interpretations selected from the whole set of interpretations. Is -1 if all interpretations are to be selected.maxNumberOfInterpretationsForModel
- the maximum number of interpretations used for the model. Those interpretations are the subset of the interpretations selected with maximum weight. Is -1 if all interpretations are used for the model. It has to be maxNumberOfSelectedInterpretations >= maxNumberOfInterpretationsForModel.
-
-
Method Detail
-
doQuery
protected double doQuery(MarkovLogicNetwork mln, FolFormula query, FolSignature signature)
Description copied from class:AbstractMlnReasoner
Performs the actual querying.- Specified by:
doQuery
in classAbstractMlnReasoner
- Parameters:
mln
- an MLNquery
- a fol formula guaranteed to be ground.signature
- the signature- Returns:
- the answer of the query.
-
computeModel
public java.util.Map<HerbrandInterpretation,java.lang.Double> computeModel(MarkovLogicNetwork mln, FolSignature signature)
Computes the model of the given MLN wrt. the optimization parameters- Parameters:
mln
- some mlnsignature
- some signature- Returns:
- the model of the given MLN wrt. the optimization parameters.
-
-