public class DerivationContext extends Object
Modifier and Type | Class | Description |
---|---|---|
static interface |
DerivationContext.StampBuilder |
Modifier and Type | Field | Description |
---|---|---|
protected Sentence |
currentBelief |
|
protected TermLink |
currentBeliefLink |
|
protected Concept |
currentConcept |
|
protected Task |
currentTask |
|
protected TaskLink |
currentTaskLink |
|
protected Term |
currentTerm |
|
boolean |
evidentalOverlap |
|
Memory |
memory |
|
Parameters |
narParameters |
|
protected Stamp |
newStamp |
|
DerivationContext.StampBuilder |
newStampBuilder |
|
private long |
original_time |
|
Timable |
time |
Constructor | Description |
---|---|
DerivationContext(Memory mem,
Parameters narParameters,
Timable time) |
Modifier and Type | Method | Description |
---|---|---|
void |
addTask(Task t,
String reason) |
tasks added with this method will be remembered by this NAL instance; useful for feedback
|
void |
addTask(Task currentTask,
BudgetValue budget,
Sentence sentence,
Sentence candidateBelief) |
Activated task called in MatchingRules.trySolution and
Concept.processGoal
|
boolean |
derivedTask(Task task,
boolean revised,
boolean single,
boolean overlapAllowed) |
Derived task comes from the inference rules.
|
boolean |
derivedTask(Task task,
boolean revised,
boolean single,
boolean overlapAllowed,
boolean addToMemory) |
|
List<Task> |
doublePremiseTask(Term newContent,
TruthValue newTruth,
BudgetValue newBudget,
boolean temporalInduction,
boolean overlapAllowed) |
Shared final operations by all double-premise rules, called from the
rules except StructuralRules
|
List<Task> |
doublePremiseTask(Term newContent,
TruthValue newTruth,
BudgetValue newBudget,
boolean temporalInduction,
boolean overlapAllowed,
boolean addToMemory) |
|
boolean |
doublePremiseTaskRevised(Term newContent,
TruthValue newTruth,
BudgetValue newBudget,
long counter) |
Shared final operations by all double-premise rules, called from the
rules except StructuralRules
|
void |
emit(Class c,
Object... o) |
|
Sentence |
getCurrentBelief() |
|
TermLink |
getCurrentBeliefLink() |
|
Concept |
getCurrentConcept() |
|
Task |
getCurrentTask() |
|
TaskLink |
getCurrentTaskLink() |
|
Term |
getCurrentTerm() |
|
Stamp |
getNewStamp() |
|
Stamp |
getTheNewStamp() |
|
long |
getTime() |
|
Memory |
mem() |
|
void |
resetOccurrenceTime() |
|
void |
setCurrentBelief(Sentence currentBelief) |
|
void |
setCurrentBeliefLink(TermLink currentBeliefLink) |
|
void |
setCurrentConcept(Concept currentConcept) |
|
void |
setCurrentTask(Task currentTask) |
|
void |
setCurrentTaskLink(TaskLink currentTaskLink) |
|
void |
setCurrentTerm(Term currentTerm) |
|
void |
setNewStamp(Stamp newStamp) |
|
Stamp |
setTheNewStamp(Stamp newStamp) |
|
void |
setTheNewStamp(Stamp first,
Stamp second,
long time) |
creates a lazy/deferred StampBuilder which only constructs the stamp if getTheNewStamp() is actually invoked
|
boolean |
singlePremiseTask(Sentence newSentence,
BudgetValue newBudget) |
|
boolean |
singlePremiseTask(Term newContent,
char punctuation,
TruthValue newTruth,
BudgetValue newBudget) |
Shared final operations by all single-premise rules, called in
StructuralRules
|
boolean |
singlePremiseTask(Term newContent,
TruthValue newTruth,
BudgetValue newBudget) |
Shared final operations by all single-premise rules, called in
StructuralRules
|
String |
toString() |
public boolean evidentalOverlap
public final Memory memory
protected Term currentTerm
protected Concept currentConcept
protected Task currentTask
protected TermLink currentBeliefLink
protected TaskLink currentTaskLink
protected Sentence currentBelief
protected Stamp newStamp
public DerivationContext.StampBuilder newStampBuilder
public Parameters narParameters
public Timable time
private long original_time
public DerivationContext(Memory mem, Parameters narParameters, Timable time)
public boolean derivedTask(Task task, boolean revised, boolean single, boolean overlapAllowed)
task
- the derived taskoverlapAllowed
- //https://groups.google.com/forum/#!topic/open-nars/FVbbKq5En-Mpublic boolean derivedTask(Task task, boolean revised, boolean single, boolean overlapAllowed, boolean addToMemory)
public boolean doublePremiseTaskRevised(Term newContent, TruthValue newTruth, BudgetValue newBudget, long counter)
newContent
- The content of the sentence in tasknewTruth
- The truth value of the sentence in tasknewBudget
- The budget value in taskpublic List<Task> doublePremiseTask(Term newContent, TruthValue newTruth, BudgetValue newBudget, boolean temporalInduction, boolean overlapAllowed)
newContent
- The content of the sentence in tasknewTruth
- The truth value of the sentence in tasknewBudget
- The budget value in tasktemporalInduction
- overlapAllowed
- // https://groups.google.com/forum/#!topic/open-nars/FVbbKq5En-Mpublic List<Task> doublePremiseTask(Term newContent, TruthValue newTruth, BudgetValue newBudget, boolean temporalInduction, boolean overlapAllowed, boolean addToMemory)
public boolean singlePremiseTask(Term newContent, TruthValue newTruth, BudgetValue newBudget)
newContent
- The content of the sentence in tasknewTruth
- The truth value of the sentence in tasknewBudget
- The budget value in taskpublic boolean singlePremiseTask(Term newContent, char punctuation, TruthValue newTruth, BudgetValue newBudget)
newContent
- The content of the sentence in taskpunctuation
- The punctuation of the sentence in tasknewTruth
- The truth value of the sentence in tasknewBudget
- The budget value in taskpublic boolean singlePremiseTask(Sentence newSentence, BudgetValue newBudget)
public long getTime()
public Stamp getNewStamp()
public void setNewStamp(Stamp newStamp)
public Task getCurrentTask()
public void setCurrentTask(Task currentTask)
currentTask
- the currentTask to setpublic void setCurrentConcept(Concept currentConcept)
public Stamp getTheNewStamp()
public void resetOccurrenceTime()
public Stamp setTheNewStamp(Stamp newStamp)
newStamp
- the newStamp to setpublic void setTheNewStamp(Stamp first, Stamp second, long time)
public Sentence getCurrentBelief()
public void setCurrentBelief(Sentence currentBelief)
currentBelief
- the currentBelief to setpublic TermLink getCurrentBeliefLink()
public void setCurrentBeliefLink(TermLink currentBeliefLink)
currentBeliefLink
- the currentBeliefLink to setpublic TaskLink getCurrentTaskLink()
public void setCurrentTaskLink(TaskLink currentTaskLink)
currentTaskLink
- the currentTaskLink to setpublic Term getCurrentTerm()
public void setCurrentTerm(Term currentTerm)
currentTerm
- the currentTerm to setpublic Concept getCurrentConcept()
public Memory mem()
public void addTask(Task t, String reason)
public void addTask(Task currentTask, BudgetValue budget, Sentence sentence, Sentence candidateBelief)
budget
- The budget value of the new Tasksentence
- The content of the new TaskcandidateBelief
- The belief to be used in future inference, for
forward/backward correspondenceCopyright © 2020 OpenNARS. All rights reserved.