public class ADMMTermStore extends Object implements TermStore<ADMMObjectiveTerm,LocalVariable>
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_PREFIX |
static String |
INTERNAL_STORE_DEFAULT |
static String |
INTERNAL_STORE_KEY
Initial size for the memory store.
|
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) |
void |
getAtomValues(float[] values)
Get the values from the atoms corresponding to global (consensus)
variables and put them in the output array.
|
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) |
Iterator<ADMMObjectiveTerm> |
iterator() |
Iterator<ADMMObjectiveTerm> |
noWriteIterator()
Get an iterator over the terms in the store that does not write to disk.
|
void |
resetLocalVairables() |
void |
resetLocalVairables(ADMMReasoner.InitialValue initialValue) |
int |
size() |
void |
updateVariables(float[] values)
Update the global variables (RVAs).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final String CONFIG_PREFIX
public static final String INTERNAL_STORE_KEY
public static final String INTERNAL_STORE_DEFAULT
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 Map<RandomVariableAtom,Integer> getGlobalVariables()
public void updateVariables(float[] values)
public void getAtomValues(float[] values)
public void resetLocalVairables()
public void resetLocalVairables(ADMMReasoner.InitialValue initialValue)
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 close()
TermStore
close
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.