public class ADMMTermStore extends Object implements TermStore<ADMMObjectiveTerm>
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(AtomFunctionVariable atomVariable)
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 capacity.
|
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.
|
List<LocalVariable> |
getLocalVariables(int globalId) |
int |
getNumGlobalVariables() |
int |
getNumLocalVariables() |
List<Integer> |
getTermIndices(WeightedGroundRule rule)
Get the indicies for all terms related to a specific rule.
|
Iterator<ADMMObjectiveTerm> |
iterator() |
void |
resetLocalVairables() |
void |
resetLocalVairables(ADMMReasoner.InitialValue initialValue) |
int |
size() |
void |
updateVariables(float[] values)
Update the global variables (AtomFunctionVariables).
|
void |
updateWeight(WeightedGroundRule rule) |
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 LocalVariable createLocalVariable(AtomFunctionVariable atomVariable)
public int getNumLocalVariables()
public int getNumGlobalVariables()
public List<LocalVariable> getLocalVariables(int globalId)
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>
public void clear()
TermStore
clear
in interface TermStore<ADMMObjectiveTerm>
public void close()
TermStore
close
in interface TermStore<ADMMObjectiveTerm>
public ADMMObjectiveTerm get(int index)
get
in interface TermStore<ADMMObjectiveTerm>
public int size()
size
in interface TermStore<ADMMObjectiveTerm>
public void ensureCapacity(int capacity)
TermStore
ensureCapacity
in interface TermStore<ADMMObjectiveTerm>
public Iterator<ADMMObjectiveTerm> iterator()
iterator
in interface Iterable<ADMMObjectiveTerm>
public void updateWeight(WeightedGroundRule rule)
updateWeight
in interface TermStore<ADMMObjectiveTerm>
public List<Integer> getTermIndices(WeightedGroundRule rule)
TermStore
getTermIndices
in interface TermStore<ADMMObjectiveTerm>
Copyright © 2018 University of California, Santa Cruz. All rights reserved.