public abstract class InferenceApplication extends Object implements ModelApplication
Modifier and Type | Field and Description |
---|---|
protected PersistedAtomManager |
atomManager |
protected Database |
db |
protected GroundRuleStore |
groundRuleStore |
protected InitialValue |
initialValue |
protected boolean |
normalizeWeights |
protected Reasoner |
reasoner |
protected double |
relaxationMultiplier |
protected boolean |
relaxationSquared |
protected boolean |
relaxHardConstraints |
protected List<Rule> |
rules |
protected TermGenerator |
termGenerator |
protected TermStore |
termStore |
Modifier | Constructor and Description |
---|---|
protected |
InferenceApplication(List<Rule> rules,
Database db) |
protected |
InferenceApplication(List<Rule> rules,
Database db,
boolean relaxHardConstraints) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases all resources used by this ModelApplication.
|
void |
commit()
Commit the results of inference to the database.
|
protected void |
completeInitialize()
Complete the initialization process.
|
protected PersistedAtomManager |
createAtomManager(Database db) |
protected GroundRuleStore |
createGroundRuleStore() |
protected Reasoner |
createReasoner() |
protected TermGenerator |
createTermGenerator() |
protected TermStore |
createTermStore() |
PersistedAtomManager |
getAtomManager() |
GroundRuleStore |
getGroundRuleStore() |
static InferenceApplication |
getInferenceApplication(String className,
List<Rule> rules,
Database db)
Construct an inference application given the data.
|
Reasoner |
getReasoner() |
TermStore |
getTermStore() |
void |
inference()
Alias for inference() with committing atoms.
|
void |
inference(boolean commitAtoms,
boolean reset)
Minimize the total weighted incompatibility of the atoms according to the rules,
and optionally commit the updated atoms back to the database.
|
protected void |
initialize()
Get objects ready for inference.
|
void |
initializeAtoms()
Set all the random variable atoms to the initial value for this inference application.
|
protected void |
internalInference()
The implementation of the full inference by each class.
|
protected void |
normalizeWeights()
Normalize all weights to be in [0, 1].
|
protected void |
relaxHardConstraints()
Relax hard constraints into weighted rules.
|
void |
setBudget(double budget)
Set a budget (given as a proportion of the max budget).
|
protected Database db
protected Reasoner reasoner
protected InitialValue initialValue
protected boolean normalizeWeights
protected boolean relaxHardConstraints
protected double relaxationMultiplier
protected boolean relaxationSquared
protected GroundRuleStore groundRuleStore
protected TermStore termStore
protected TermGenerator termGenerator
protected PersistedAtomManager atomManager
protected void initialize()
protected PersistedAtomManager createAtomManager(Database db)
protected GroundRuleStore createGroundRuleStore()
protected Reasoner createReasoner()
protected TermGenerator createTermGenerator()
protected TermStore createTermStore()
protected void completeInitialize()
public void inference()
public void inference(boolean commitAtoms, boolean reset)
protected void internalInference()
public Reasoner getReasoner()
public GroundRuleStore getGroundRuleStore()
public TermStore getTermStore()
public PersistedAtomManager getAtomManager()
public void setBudget(double budget)
public void initializeAtoms()
public void commit()
public void close()
ModelApplication
close
in interface ModelApplication
protected void normalizeWeights()
protected void relaxHardConstraints()
public static InferenceApplication getInferenceApplication(String className, List<Rule> rules, Database db)
Copyright © 2020 University of California, Santa Cruz. All rights reserved.