Search in sources :

Example 1 with Anticipate

use of nars.operator.mental.Anticipate 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;
}
Also used : Operator(nars.operator.Operator) FunctionOperator(nars.operator.FunctionOperator) Believe(nars.operator.mental.Believe) Anticipate(nars.operator.mental.Anticipate) Evaluate(nars.operator.mental.Evaluate) Want(nars.operator.mental.Want) Operation(nars.operator.Operation) Wonder(nars.operator.mental.Wonder)

Example 2 with Anticipate

use of nars.operator.mental.Anticipate in project opennars by opennars.

the class Plugins method init.

public NAR init(NAR n) {
    n.addPlugin(new RuntimeNARSettings());
    n.addPlugin(new Emotions());
    // expect an event
    n.addPlugin(new Anticipate());
    // Term label = SetInt.make(new Term("bright"));
    // n.addSensoryChannel(label.toString(),
    // new VisionChannel(label, n, n, 1, 1));
    boolean full_internal_experience = false;
    if (!full_internal_experience) {
        n.addPlugin(new InternalExperience());
    } else {
        n.addPlugin(new FullInternalExperience());
        n.addPlugin(new Abbreviation());
        n.addPlugin(new Counting());
    }
    return n;
}
Also used : RuntimeNARSettings(nars.plugin.misc.RuntimeNARSettings) Abbreviation(nars.plugin.mental.Abbreviation) FullInternalExperience(nars.plugin.mental.FullInternalExperience) InternalExperience(nars.plugin.mental.InternalExperience) FullInternalExperience(nars.plugin.mental.FullInternalExperience) Anticipate(nars.operator.mental.Anticipate) Emotions(nars.plugin.mental.Emotions) Counting(nars.plugin.mental.Counting)

Aggregations

Anticipate (nars.operator.mental.Anticipate)2 FunctionOperator (nars.operator.FunctionOperator)1 Operation (nars.operator.Operation)1 Operator (nars.operator.Operator)1 Believe (nars.operator.mental.Believe)1 Evaluate (nars.operator.mental.Evaluate)1 Want (nars.operator.mental.Want)1 Wonder (nars.operator.mental.Wonder)1 Abbreviation (nars.plugin.mental.Abbreviation)1 Counting (nars.plugin.mental.Counting)1 Emotions (nars.plugin.mental.Emotions)1 FullInternalExperience (nars.plugin.mental.FullInternalExperience)1 InternalExperience (nars.plugin.mental.InternalExperience)1 RuntimeNARSettings (nars.plugin.misc.RuntimeNARSettings)1