00001 /* 00002 * Created on Nov 9, 2009 00003 * 00004 * TODO To change the template for this generated file go to 00005 * Window - Preferences - Java - Code Style - Code Templates 00006 */ 00007 package edu.tum.cs.srl.bayesnets; 00008 00009 import edu.tum.cs.logic.Formula; 00010 import edu.tum.cs.srl.Signature; 00011 import edu.tum.cs.srl.mln.MarkovLogicNetwork; 00012 00017 public abstract class MLNConverter { 00018 public abstract void addGuaranteedDomainElements(String domain, String[] elements); 00019 public abstract void addSignature(Signature sig); 00020 public abstract void beginCPT(RelationalNode node); 00021 public abstract void addFormula(edu.tum.cs.logic.Formula f, double weight); 00022 public abstract void addHardFormula(Formula f); 00023 public abstract void endCPT(); 00024 public abstract void addFunctionalDependency(String predicate, Integer functionallyDeterminedArg); 00025 00026 public static class MLNObjectWriter extends MLNConverter { 00027 public MarkovLogicNetwork mln; 00028 00029 public MLNObjectWriter() { 00030 mln = new MarkovLogicNetwork(); 00031 } 00032 00033 @Override 00034 public void addFormula(Formula f, double weight) { 00035 mln.addFormula(f, weight); 00036 } 00037 00038 @Override 00039 public void addFunctionalDependency(String predicate, Integer functionallyDeterminedArg) { 00040 mln.addFunctionalDependency(predicate, functionallyDeterminedArg); 00041 } 00042 00043 @Override 00044 public void addSignature(Signature sig) { 00045 mln.addSignature(sig); 00046 } 00047 00048 @Override 00049 public void beginCPT(RelationalNode node) { 00050 } 00051 00052 @Override 00053 public void endCPT() { 00054 } 00055 00056 public MarkovLogicNetwork getMLN() { 00057 return mln; 00058 } 00059 00060 @Override 00061 public void addGuaranteedDomainElements(String domain, String[] elements) { 00062 mln.addGuaranteedDomainElements(domain, elements); 00063 } 00064 00065 @Override 00066 public void addHardFormula(Formula f) { 00067 mln.addHardFormula(f); 00068 } 00069 } 00070 } 00071