|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnars.main.Memory
public class Memory
The memory of the system.
Field Summary | |
---|---|
private static ConceptBag |
concepts
Concept bag. |
static Judgment |
currentBelief
Shortcut to the selected belief |
static TermLink |
currentBeliefLink
Shortcut to the selected TermLink |
static Stamp |
currentStamp
Shortcut to the derived Stamp |
static Task |
currentTask
Shortcut to the selected Task |
static TaskLink |
currentTaskLink
Shortcut to the selected TaskLink |
static TemporalValue |
currentTense
Shortcut to the derived tense |
static Term |
currentTerm
Shortcut to the selected Term |
private static java.util.ArrayList<Task> |
newTasks
List of inference newTasks, to be processed in the next working cycle |
private static TaskBuffer |
novelTasks
New tasks with novel composed terms, for delayed and selective processing |
private static java.util.HashMap<java.lang.String,Operator> |
operators
Operators (built-in terms) table. |
private static TaskBuffer |
recentEvents
List of recent events, for temporal learning |
Constructor Summary | |
---|---|
Memory()
|
Method Summary | |
---|---|
static void |
activateConcept(Concept c,
BudgetValue b)
Adjust the activation level of a Concept |
static void |
activatedTask(BudgetValue budget,
Sentence sentence,
boolean isInput)
Activated task coming from MatchingRules.trySolution |
static void |
conceptsStartPlay(java.lang.String s)
Display active concepts, called from MainWindow. |
private static void |
continuedProcess(Task task,
Term content)
Link to a new task from all relevant concepts for continued processing in the near future for unspecified time. |
static void |
convertedJudgment(TruthValue truth,
BudgetValue budget)
Convert jusgment into different relation |
static void |
cycle()
An atomic working cycle of the system: process new Tasks, then fire a concept |
private static void |
derivedTask(Task task)
Derived task comes from the inference rules. |
static void |
doublePremiseTask(BudgetValue budget,
Term content,
TruthValue truth)
Shared final operations by all double-premise rules, called from the rules except StructuralRules |
private static void |
eventProcessing(Task event1)
Simple temporal regularity discovery [To be refined] |
static void |
executedTask(Task task)
Reporting executed task, and remember the event |
static Concept |
getConcept(Term term)
Get the Concept associated to a Term, or create it. |
private static void |
immediateProcess(Task task)
Imediate processing of a new task, in constant time Local processing, in one concept only |
static void |
init()
Initialize a new memory by creating all members. |
static void |
inputTask(Task task)
Input task processing. |
static Concept |
nameToConcept(java.lang.String name)
Get an existing Concept for a given name |
static Term |
nameToListedTerm(java.lang.String name)
Get a Term for a given name of a Concept or Operator |
static Operator |
nameToOperator(java.lang.String name)
Check if a string is an operator name |
static void |
newTasksStartPlay(java.lang.String s)
Display newd tasks, called from MainWindow. |
static java.lang.String |
newTasksToString()
Prepare buffered tasks for display, called from TaskBuffer. |
static boolean |
noResult()
Check if there is already any derived Task in the current cycle |
private static void |
processConcept()
Select a concept to fire. |
private static void |
processTask()
Process the newTasks accumulated in the previous cycle, accept input ones and those that corresponding to existing concepts, plus one from the buffer. |
static void |
report(Sentence sentence,
boolean input)
Display input/output sentence in the MainWindow. |
static void |
singlePremiseTask(BudgetValue budget,
Term content,
TruthValue truth)
Shared final operations by all single-premise rules, called in StructuralRules |
static Concept |
termToConcept(Term term)
Get an existing Concept for a given Term. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static ConceptBag concepts
private static java.util.HashMap<java.lang.String,Operator> operators
private static java.util.ArrayList<Task> newTasks
private static TaskBuffer novelTasks
private static TaskBuffer recentEvents
public static Term currentTerm
public static TaskLink currentTaskLink
public static Task currentTask
public static TermLink currentBeliefLink
public static Judgment currentBelief
public static Stamp currentStamp
public static TemporalValue currentTense
Constructor Detail |
---|
public Memory()
Method Detail |
---|
public static void init()
Called in Center.reset only
public static Term nameToListedTerm(java.lang.String name)
called in StringParser and the make methods of compound terms.
name
- the name of a concept or operator
public static Operator nameToOperator(java.lang.String name)
called in StringParser only.
name
- the name of a possible operator
public static Concept nameToConcept(java.lang.String name)
called from Term and ConceptWindow.
name
- the name of a concept
public static Concept termToConcept(Term term)
term
- The Term naming a concept
public static Concept getConcept(Term term)
term
- indicating the concept
public static void activateConcept(Concept c, BudgetValue b)
called in Concept.insertTaskLink only
c
- the concept to be adustedb
- the new BudgetValuepublic static boolean noResult()
called in Concept.fire only
public static void inputTask(Task task)
task
- the input taskprivate static void derivedTask(Task task)
task
- the derived taskpublic static void executedTask(Task task)
called from Operator.call only
task
- the executed taskpublic static void activatedTask(BudgetValue budget, Sentence sentence, boolean isInput)
budget
- The budget value of the new Tasksentence
- The content of the new TaskisInput
- Whether the question is inputpublic static void doublePremiseTask(BudgetValue budget, Term content, TruthValue truth)
budget
- The budget value of the new taskcontent
- The content of the new tasktruth
- The truth value of the new taskpublic static void singlePremiseTask(BudgetValue budget, Term content, TruthValue truth)
budget
- The budget value of the new taskcontent
- The content of the new tasktruth
- The truth value of the new taskpublic static void convertedJudgment(TruthValue truth, BudgetValue budget)
called in MatchingRules
budget
- The budget value of the new tasktruth
- The truth value of the new taskpublic static void cycle()
Called from Center.tick only
private static void processTask()
private static void processConcept()
private static void immediateProcess(Task task)
task
- the task to be acceptedprivate static void continuedProcess(Task task, Term content)
The only method that calls the TaskLink constructor.
task
- The task to be linkedcontent
- The content of the taskprivate static void eventProcessing(Task event1)
called in Memory.immediateProcess
event1
- A new eventpublic static void conceptsStartPlay(java.lang.String s)
s
- the window titlepublic static void newTasksStartPlay(java.lang.String s)
s
- the window titlepublic static java.lang.String newTasksToString()
public static void report(Sentence sentence, boolean input)
sentence
- the sentence to be displayedinput
- whether the task is input
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |