Class SimpleMlnReasoner
- java.lang.Object
-
- net.sf.tweety.logics.mln.reasoner.AbstractMlnReasoner
-
- net.sf.tweety.logics.mln.reasoner.SimpleMlnReasoner
-
- All Implemented Interfaces:
QuantitativeReasoner<MarkovLogicNetwork,FolFormula>
,Reasoner<java.lang.Double,MarkovLogicNetwork,FolFormula>
public class SimpleMlnReasoner extends AbstractMlnReasoner
- Author:
- mthimm
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
tempDirectory
Directory for temporary files.
-
Constructor Summary
Constructors Constructor Description SimpleMlnReasoner()
-
Method Summary
Modifier and Type Method Description private java.io.File
computeModel(MarkovLogicNetwork mln, FolSignature signature)
Computes the model of the given MLN.double
doQuery(MarkovLogicNetwork mln, FolFormula query, FolSignature signature)
Performs the actual querying.private HerbrandInterpretation
parseInterpretation(java.lang.String str, FolSignature signature)
Constructs a Herbrand interpretation from the given stringvoid
setTempDirectory(java.lang.String str)
Sets the path of the directory for temporary files.-
Methods inherited from class net.sf.tweety.logics.mln.reasoner.AbstractMlnReasoner
computeWeight, numberOfGroundSatisfactions, query, query
-
-
-
-
Method Detail
-
setTempDirectory
public void setTempDirectory(java.lang.String str)
Sets the path of the directory for temporary files.- Parameters:
str
- a file path
-
computeModel
private java.io.File computeModel(MarkovLogicNetwork mln, FolSignature signature)
Computes the model of the given MLN.- Parameters:
mln
- The MLNsignature
- the signature- Returns:
- a file where the model is stored.
-
doQuery
public 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.
-
parseInterpretation
private HerbrandInterpretation parseInterpretation(java.lang.String str, FolSignature signature)
Constructs a Herbrand interpretation from the given string- Parameters:
str
- a string.signature
- the signature- Returns:
- a Herbrand interpretation
-
-