grounding
Class LazyGrounding

java.lang.Object
  extended by grounding.LazyGrounding

public class LazyGrounding
extends java.lang.Object

Methods related to lazy inference. It's the idea of presuming all unknown atoms to be false at the beginning, and "activate" them and related clauses only if necessary in an on-demand manner.


Constructor Summary
LazyGrounding(MarkovLogicNetwork mln)
          Creates a grounding worker for an MLN.
 
Method Summary
 void activateAtom(int oldID, int newID, java.lang.String relBuf)
          Activates a new atom, grounding clauses as necessary.
 int computeActiveAtoms(boolean firstRoundOnly)
          Computes the closure of active atoms.
 int computeActiveClauses(boolean retainInactiveAtoms)
          Computes ground clauses activated by the current set of active atoms.
 void constructMRF(boolean firstRoundOnly)
          Constructs the MRF.
 int getNumAtoms()
          Returns the number of active variables in the grounding result.
 int getNumClauses()
          Returns the number of active clauses in the grounding result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyGrounding

public LazyGrounding(MarkovLogicNetwork mln)
Creates a grounding worker for an MLN.

Method Detail

activateAtom

public void activateAtom(int oldID,
                         int newID,
                         java.lang.String relBuf)
Activates a new atom, grounding clauses as necessary.

Parameters:
oldID - old atom ID
newID - new atom ID
relBuf - name of relation where new clauses will be stored

computeActiveAtoms

public int computeActiveAtoms(boolean firstRoundOnly)
Computes the closure of active atoms.

Parameters:
firstRoundOnly - setting this to true makes the method behave like the initialization step of lazy Alchemy
Returns:
number of active atoms

computeActiveClauses

public int computeActiveClauses(boolean retainInactiveAtoms)
Computes ground clauses activated by the current set of active atoms.

Parameters:
retainInactiveAtoms - set this to true when the original lazy inference is in use. Otherwise, i.e. the closure algorithm is in use, set it to false.
Returns:
number of active clauses

constructMRF

public void constructMRF(boolean firstRoundOnly)
Constructs the MRF.

See Also:
computeActiveAtoms(boolean), computeActiveClauses(boolean)

getNumAtoms

public int getNumAtoms()
Returns the number of active variables in the grounding result.


getNumClauses

public int getNumClauses()
Returns the number of active clauses in the grounding result.