use of nars.operator.mental.Want in project opennars by opennars.
the class ConceptProcessing method processTask.
/**
* Directly process a new task. Called exactly once on each task. Using
* local information and finishing in a constant time. Provide feedback in
* the taskBudget value of the task.
* <p>
* called in Memory.immediateProcess only
*
* @param task The task to be processed
* @return whether it was processed
*/
public static boolean processTask(Concept concept, final DerivationContext nal, final Task task) {
if (task.isInput()) {
if (task.sentence.isJudgment() && !task.sentence.isEternal() && task.sentence.term instanceof Operation) {
Operation op = (Operation) task.sentence.term;
Operator o = (Operator) op.getPredicate();
// only consider these mental ops an operation to track when executed not already when generated as internal event
if (!(o instanceof Believe) && !(o instanceof Want) && !(o instanceof Wonder) && !(o instanceof Evaluate) && !(o instanceof Anticipate)) {
TemporalInferenceControl.NewOperationFrame(nal.memory, task);
}
}
concept.observable = true;
}
char type = task.sentence.punctuation;
switch(type) {
case Symbols.JUDGMENT_MARK:
// memory.logic.JUDGMENT_PROCESS.commit();
processJudgment(concept, nal, task);
break;
case Symbols.GOAL_MARK:
// memory.logic.GOAL_PROCESS.commit();
processGoal(concept, nal, task, true);
break;
case Symbols.QUESTION_MARK:
case Symbols.QUEST_MARK:
// memory.logic.QUESTION_PROCESS.commit();
processQuestion(concept, nal, task);
break;
default:
return false;
}
maintainDisappointedAnticipations(concept);
if (task.aboveThreshold()) {
// still need to be processed
// memory.logic.LINK_TO_TASK.commit();
concept.linkToTask(task, nal);
}
return true;
}
Aggregations