infer
Class MZone

java.lang.Object
  extended by infer.MZone

public class MZone
extends java.lang.Object

An memory area that stores part or the whole of the MRF. May contain either 1) one or multiple components in whole; or 2) one or multiple partitions of one component.


Nested Class Summary
static class MZone.CompThread
          A worker thread that runs inference on one component at a time.
 
Constructor Summary
MZone(RDB db, PartMap pmap, java.util.ArrayList<Component> comps)
          Construct a memory zone to hold a number of components.
MZone(RDB db, PartMap pmap, boolean wholeComps)
          Construct an initially empty memory zone.
MZone(RDB db, PartMap pmap, Component comp, java.util.ArrayList<Partition> parts)
          Construct a memory zone to hold a number of partitions in a certain component.
 
Method Summary
 void addComponent(Component c)
          Add a component to this zone.
 void addCost(double c)
          Add up the cost.
 void addPart(Partition p)
          Add a partition to this zone.
 void discard()
          Discard all data structues to facilitate GC.
 void dumpTruth()
          Flush the truth table to the DB.
 double getCost()
          Get the cost after inference.
 Component getTask()
          Get next unprocessed task (i.e., component)
 void load()
          Load the set of components or partitions.
 void runInfer(int ntries, int nflips)
          Solve the set of components/partitions in this zone.
 long size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MZone

public MZone(RDB db,
             PartMap pmap,
             java.util.ArrayList<Component> comps)
Construct a memory zone to hold a number of components.

Parameters:
db -
pmap - the partitioning scheme
comps - the components to be loaded

MZone

public MZone(RDB db,
             PartMap pmap,
             boolean wholeComps)
Construct an initially empty memory zone.

Parameters:
db -
pmap -
wholeComps - indicates whether this zone will hold a set of components or a set of partitions.
See Also:
addComponent(Component), addPart(Partition)

MZone

public MZone(RDB db,
             PartMap pmap,
             Component comp,
             java.util.ArrayList<Partition> parts)
Construct a memory zone to hold a number of partitions in a certain component.

Parameters:
db -
pmap -
comp - the (usually big) component
parts - the partitions to be loaded
Method Detail

addComponent

public void addComponent(Component c)
Add a component to this zone.

Parameters:
c -
See Also:
MZone(RDB, PartMap, boolean)

addCost

public void addCost(double c)
Add up the cost.

Parameters:
c -
See Also:
MZone.CompThread.run()

addPart

public void addPart(Partition p)
Add a partition to this zone.

See Also:
MZone(RDB, PartMap, boolean)

discard

public void discard()
Discard all data structues to facilitate GC.


dumpTruth

public void dumpTruth()
Flush the truth table to the DB.


getCost

public double getCost()
Get the cost after inference.


getTask

public Component getTask()
Get next unprocessed task (i.e., component)

See Also:
MZone.CompThread.run()

load

public void load()
Load the set of components or partitions.


runInfer

public void runInfer(int ntries,
                     int nflips)
Solve the set of components/partitions in this zone.

Parameters:
ntries -
nflips -

size

public long size()