Serializable
public class Concept extends Item<Term> implements Serializable
Modifier and Type | Class | Description |
---|---|---|
static class |
Concept.AnticipationEntry |
Item.ItemPriorityComparator<E extends Item>, Item.StringKeyItem
Modifier and Type | Field | Description |
---|---|---|
float |
acquiredQuality |
|
boolean |
allowBabbling |
|
List<Concept.AnticipationEntry> |
anticipations |
|
List<Task> |
beliefs |
Judgments directly made about the term Use List because of access
and insertion in the middle
|
List<Task> |
desires |
Desire values on the term, similar to the above one
|
List<Task> |
executable_preconditions |
|
List<Task> |
general_executable_preconditions |
|
Memory |
memory |
Reference to the memory to which the Concept belongs
|
boolean |
observable |
|
List<Task> |
questions |
Pending Question directly asked about the term
Note: since this is iterated frequently, an array should be used.
|
List<Task> |
quests |
Pending Quests to be answered by new desire values
|
List<Float> |
recent_intervals |
|
Bag<Task<Term>,Sentence<Term>> |
seq_before |
|
Bag<TaskLink,Task> |
taskLinks |
Task links for indirect processing
|
Term |
term |
The term is the unique ID of the concept
|
Bag<TermLink,TermLink> |
termLinks |
Term links between the term and its components and compounds; beliefs
|
List<TermLink> |
termLinkTemplates |
Link templates of TermLink, only in concepts with CompoundTerm Templates
are used to improve the efficiency of TermLink building
|
Constructor | Description |
---|---|
Concept(BudgetValue b,
Term tm,
Memory memory) |
Constructor, called in Memory.getConcept only
|
Modifier and Type | Method | Description |
---|---|---|
void |
addToTable(Task task,
boolean rankTruthExpectation,
List<Task> table,
int max,
Class eventAdd,
Class eventRemove,
Object... extraEventArguments) |
|
static Task |
addToTable(Task newTask,
List<Task> table,
int capacity,
boolean rankTruthExpectation) |
Add a new belief (or goal) into the table Sort the beliefs/desires by
rank, and remove redundant or low rank one
|
void |
buildTermLinks(BudgetValue taskBudget,
Parameters narParameters) |
Recursively build TermLinks between a compound and its components
|
void |
discountConfidence(boolean onBeliefs) |
|
boolean |
equals(Object obj) |
|
Sentence |
getBelief(DerivationContext nal,
Task task) |
Select a isBelief to interact with the given task in inference
|
List<Task> |
getBeliefs() |
returns unmodifidable collection wrapping beliefs
|
TruthValue |
getDesire() |
Get the current overall desire value.
|
List<Task> |
getDesires() |
returns unmodifidable collection wrapping beliefs
|
float |
getQuality() |
Recalculate the quality of the concept [to be refined to show
extension/intension balance]
|
List<Task> |
getQuess() |
|
List<Task> |
getQuestions() |
Return the questions, called in ComposionalRules in
dedConjunctionByQuestion only
|
Term |
getTerm() |
|
List<TermLink> |
getTermLinkTemplates() |
Return the templates for TermLinks, only called in
Memory.continuedProcess
|
int |
hashCode() |
|
void |
incAcquiredQuality() |
|
protected boolean |
insertTaskLink(TaskLink taskLink,
DerivationContext nal) |
Insert a TaskLink into the TaskLink bag
|
boolean |
insertTermLink(TermLink termLink) |
Insert a TermLink into the TermLink bag
|
TaskLink |
linkToTask(Task task,
DerivationContext content) |
Link to a new task from all relevant concepts for continued processing in
the near future for unspecified time.
|
Term |
name() |
Get the current key
|
Symbols.NativeOperator |
operator() |
|
void |
returnTermLink(TermLink termLink) |
|
Task |
selectCandidate(Task query,
List<Task> list,
Timable time) |
Select a belief value or desire value for a given query
|
TermLink |
selectTermLink(TaskLink taskLink,
long time,
Parameters narParameters) |
Replace default to prevent repeated inference, by checking TaskLink
|
String |
toString() |
Return a string representation of the concept, called in ConceptBag only
|
private String |
toStringIfNotNull(Object item,
String title) |
|
String |
toStringLong() |
called from
Shell |
decDurability, decPriority, getBudget, getDurability, getPriority, getPrioritySum, incDurability, incPriority, merge, setDurability, setPriority, setQuality, toStringExternal, toStringExternal2
public final Term term
public final Bag<TermLink,TermLink> termLinks
public final List<TermLink> termLinkTemplates
public final List<Task> questions
public final List<Task> beliefs
public final Memory memory
public boolean observable
public boolean allowBabbling
public List<Concept.AnticipationEntry> anticipations
public float acquiredQuality
public Concept(BudgetValue b, Term tm, Memory memory)
tm
- A term corresponding to the conceptmemory
- A reference to the memorypublic void addToTable(Task task, boolean rankTruthExpectation, List<Task> table, int max, Class eventAdd, Class eventRemove, Object... extraEventArguments)
public TaskLink linkToTask(Task task, DerivationContext content)
The only method that calls the TaskLink constructor.
task
- The task to be linkedcontent
- The content of the taskpublic static Task addToTable(Task newTask, List<Task> table, int capacity, boolean rankTruthExpectation)
table
- The table to be revisedcapacity
- The capacity of the tablepublic Task selectCandidate(Task query, List<Task> list, Timable time)
query
- The query to be processedlist
- The list of beliefs or desires to be usedprotected boolean insertTaskLink(TaskLink taskLink, DerivationContext nal)
called only from Memory.continuedProcess
taskLink
- The termLink to be insertedpublic void buildTermLinks(BudgetValue taskBudget, Parameters narParameters)
called only from Memory.continuedProcess
taskBudget
- The BudgetValue of the taskpublic boolean insertTermLink(TermLink termLink)
called from buildTermLinks only
termLink
- The termLink to be insertedpublic String toString()
public String toStringLong()
Shell
toStringLong
in class Item<Term>
public void incAcquiredQuality()
public float getQuality()
getQuality
in class Item<Term>
public List<TermLink> getTermLinkTemplates()
public Sentence getBelief(DerivationContext nal, Task task)
get the first qualified one
only called in RuleTables.reason
task
- The selected taskpublic TruthValue getDesire()
public TermLink selectTermLink(TaskLink taskLink, long time, Parameters narParameters)
taskLink
- The selected TaskLinktime
- The current timepublic void returnTermLink(TermLink termLink)
public List<Task> getQuestions()
public void discountConfidence(boolean onBeliefs)
public Symbols.NativeOperator operator()
public Term getTerm()
Copyright © 2020 OpenNARS. All rights reserved.