tuffy.infer
Class InferBucket

java.lang.Object
  extended by tuffy.infer.InferBucket

public class InferBucket
extends java.lang.Object

A bucket of inference tasks that can run in prallel. Currently, each task correspond to an MRF component so that the components can be processed in parallel.


Nested Class Summary
static class InferBucket.CompWorker
          A worker thread that runs inference on one component at a time.
 
Field Summary
private  Bucket bucket
           
private  double cost
           
private  int numThreads
           
private  java.util.ArrayList<Component> q
          The queue of components to be processed
private  java.lang.Object sentinel
           
(package private)  Settings settings
           
(package private)  Config.TUFFY_INFERENCE_TASK task
           
 
Constructor Summary
InferBucket(Bucket bucket)
           
 
Method Summary
 void addCost(double c)
          Add up the cost.
 void flushAtomStates(DataMover dmover, java.lang.String relAtoms)
           
 double getCost()
          Get the cost after inference.
 int getNumThreads()
           
 Component getTask()
          Get the next unprocessed component in the queue
 void infer(Settings s)
           
private  void runInferParallel()
          Solve the components in parallel.
 void setMrfInitStrategy(MRF.INIT_STRATEGY strategy)
           
 void setNumThreads(int numThreads)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bucket

private Bucket bucket

numThreads

private int numThreads

cost

private double cost

task

Config.TUFFY_INFERENCE_TASK task

settings

Settings settings

sentinel

private java.lang.Object sentinel

q

private java.util.ArrayList<Component> q
The queue of components to be processed

Constructor Detail

InferBucket

public InferBucket(Bucket bucket)
Method Detail

infer

public void infer(Settings s)

flushAtomStates

public void flushAtomStates(DataMover dmover,
                            java.lang.String relAtoms)

setMrfInitStrategy

public void setMrfInitStrategy(MRF.INIT_STRATEGY strategy)

getCost

public double getCost()
Get the cost after inference.


addCost

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

Parameters:
c -
See Also:
InferBucket.CompWorker.run()

getTask

public Component getTask()
Get the next unprocessed component in the queue

See Also:
InferBucket.CompWorker.run()

runInferParallel

private void runInferParallel()
Solve the components in parallel.

Parameters:
ntries -
nflips -

setNumThreads

public void setNumThreads(int numThreads)

getNumThreads

public int getNumThreads()