public class ADMMTermStore extends Object implements TermStore<ADMMObjectiveTerm,LocalVariable>
Constructor and Description |
---|
ADMMTermStore() |
ADMMTermStore(TermStore<ADMMObjectiveTerm,?> store) |
Modifier and Type | Method and Description |
---|---|
void |
add(GroundRule rule,
ADMMObjectiveTerm term)
Add a term to the store that was generated from the given ground rule.
|
void |
clear()
Remove any existing terms and prepare for a new set.
|
void |
close()
Close down the term store, it will not be used any more.
|
LocalVariable |
createLocalVariable(RandomVariableAtom atom)
Create a local variable and ensure that a global copy is registered.
|
void |
ensureCapacity(int capacity)
Ensure that the underlying stuctures can have the required term capacity.
|
void |
ensureVariableCapacity(int capacity)
Make sure we allocate the right amount of memory for global variables.
|
ADMMObjectiveTerm |
get(int index) |
float[] |
getConsensusValues() |
Map<RandomVariableAtom,Integer> |
getGlobalVariables()
Get the RVAs managed by this term store.
|
List<LocalVariable> |
getLocalVariables(int globalId) |
int |
getNumGlobalVariables() |
int |
getNumLocalVariables() |
Iterable<ADMMObjectiveTerm> |
getTerms(GroundRule groundRule) |
void |
initForOptimization()
A notification by the Reasoner that optimization is about to begin.
|
void |
iterationComplete()
A notification by the Reasoner that a single iteration is complete.
|
Iterator<ADMMObjectiveTerm> |
iterator() |
Iterator<ADMMObjectiveTerm> |
noWriteIterator()
Get an iterator over the terms in the store that does not write to disk.
|
void |
reset()
Reset the existing terms for another round of inference.
|
int |
size() |
void |
updateVariables()
Update the global variables (atoms) with the consensus values.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public ADMMTermStore()
public ADMMTermStore(TermStore<ADMMObjectiveTerm,?> store)
public void ensureVariableCapacity(int capacity)
ensureVariableCapacity
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public LocalVariable createLocalVariable(RandomVariableAtom atom)
createLocalVariable
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public int getNumLocalVariables()
public int getNumGlobalVariables()
public List<LocalVariable> getLocalVariables(int globalId)
public float[] getConsensusValues()
public Map<RandomVariableAtom,Integer> getGlobalVariables()
public void updateVariables()
public void add(GroundRule rule, ADMMObjectiveTerm term)
TermStore
add
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public void clear()
TermStore
clear
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public void reset()
TermStore
reset
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public void close()
TermStore
close
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public void initForOptimization()
TermStore
initForOptimization
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public void iterationComplete()
TermStore
iterationComplete
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public ADMMObjectiveTerm get(int index)
get
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public int size()
size
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public void ensureCapacity(int capacity)
TermStore
ensureCapacity
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public Iterator<ADMMObjectiveTerm> iterator()
iterator
in interface Iterable<ADMMObjectiveTerm>
public Iterator<ADMMObjectiveTerm> noWriteIterator()
TermStore
noWriteIterator
in interface TermStore<ADMMObjectiveTerm,LocalVariable>
public Iterable<ADMMObjectiveTerm> getTerms(GroundRule groundRule)
Copyright © 2020 University of California, Santa Cruz. All rights reserved.