当前位置: 首页>>代码示例>>Java>>正文


Java Task.isInput方法代码示例

本文整理汇总了Java中nars.entity.Task.isInput方法的典型用法代码示例。如果您正苦于以下问题:Java Task.isInput方法的具体用法?Java Task.isInput怎么用?Java Task.isInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nars.entity.Task的用法示例。


在下文中一共展示了Task.isInput方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processNewTask

import nars.entity.Task; //导入方法依赖的package包/类
/**
 * Process the newTasks accumulated in the previous workCycle, accept input ones
 * and those that corresponding to existing concepts, plus one from the buffer.
 */
private void processNewTask() {
    Task task;
    int counter = newTasks.size();  // don't include new tasks produced in the current workCycle
    while (counter-- > 0) {
        task = newTasks.remove(0);
        if (task.isInput() || (termToConcept(task.getContent()) != null)) { // new input or existing concept
            immediateProcess(task);
        } else {
            Sentence s = task.getSentence();
            if (s.isJudgment()) {
                double d = s.getTruth().getExpectation();
                if (d > Parameters.DEFAULT_CREATION_EXPECTATION) {
                    novelTasks.putIn(task);    // new concept formation
                } else {
                    recorder.append("!!! Neglected: " + task + "\n");
                }
            }
        }
    }
}
 
开发者ID:automenta,项目名称:opennars,代码行数:25,代码来源:Memory.java

示例2: processNewTask

import nars.entity.Task; //导入方法依赖的package包/类
/**
 * Process the newTasks accumulated in the previous workCycle, accept input
 * ones and those that corresponding to existing concepts, plus one from the
 * buffer.
 */
private void processNewTask() {
            
    // don't include new tasks produced in the current workCycle
    int counter = newTasks.size();  
    while (counter-- > 0) {
        final Task task = newTasks.removeFirst();
        if (task.isInput() || (termToConcept(task.getContent()) != null)) { 
            // new input or existing concept
            immediateProcess(task);
        } else {
            final Sentence s = task.getSentence();
            if (s.isJudgment()) {
                final double exp = s.getTruth().getExpectation();
                if (exp > Parameters.DEFAULT_CREATION_EXPECTATION) {
                    novelTasks.putIn(task);    // new concept formation
                } else {
                    if (recorder.isActive()) {
                        recorder.append("!!! Neglected: " + task + "\n");
                    }
                }
            }
        }
    }
}
 
开发者ID:automenta,项目名称:opennars,代码行数:30,代码来源:Memory.java


注:本文中的nars.entity.Task.isInput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。