|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfer.BDBStore
public class BDBStore
Manager of the data used by inference. Using BDB JE.
Field Summary | |
---|---|
long |
inferOps
|
protected double |
lowCost
|
protected java.util.Random |
rand
|
Constructor Summary | |
---|---|
BDBStore(Grounding grounding)
Creates a BDB store to host inference algorithms. |
Method Summary | |
---|---|
protected void |
activateAtom(java.lang.String relBuf,
int oldID)
|
protected void |
assignRandomTruthValues()
Assigns random truth values to active atoms. |
protected double |
calcCosts()
|
boolean |
close()
Closes all opened handles. |
void |
dumpAtomProb(int numSamples,
java.lang.String fout)
|
protected void |
fixAtom(int id,
boolean val)
|
void |
flushTruthValues()
|
void |
infer(int numTries,
int maxIterations)
Place holder for the actual inference algorithms in children classes. |
protected void |
initMRF()
Initializes the states of the MRF. |
static byte[] |
intToByteArray(int value)
Converts an integer into a byte array. |
protected boolean |
isActive(int atomID)
Tests if an atom ID is in the range of active ones. |
protected void |
resetDeadClauses()
|
protected void |
resetFixedAtoms()
|
protected void |
restoreLowTruth()
|
protected int |
retainOnlyHardClauses()
|
protected int |
retainSomeGoodClauses()
|
protected boolean |
saveLowTruth(double cost)
Saves the truth values if the current world has the lowest cost so far. |
protected void |
tallyAtomTrueCount()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public long inferOps
protected double lowCost
protected java.util.Random rand
Constructor Detail |
---|
public BDBStore(Grounding grounding)
mln
- the MLNgrounding
- the grounding worker for this MLNMethod Detail |
---|
protected void activateAtom(java.lang.String relBuf, int oldID)
protected void assignRandomTruthValues()
protected double calcCosts()
public boolean close()
public void dumpAtomProb(int numSamples, java.lang.String fout)
protected void fixAtom(int id, boolean val)
public void flushTruthValues()
public void infer(int numTries, int maxIterations)
maxIterations
- protected void initMRF()
public static final byte[] intToByteArray(int value)
protected boolean isActive(int atomID)
atomID
-
protected void resetDeadClauses()
protected void resetFixedAtoms()
protected void restoreLowTruth()
protected int retainOnlyHardClauses()
protected int retainSomeGoodClauses()
protected boolean saveLowTruth(double cost)
cost
- the cost of current world
protected void tallyAtomTrueCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |