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


Java Stamp类代码示例

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


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

示例1: reset

import nars.entity.Stamp; //导入依赖的package包/类
/**
 * Reset the system with an empty memory and reset clock. Called locally and from MainWindow.
 */
public void reset() {
    running = false;
    walkingSteps = 0;
    clock = 0;
    memory.init();
    Stamp.init();
}
 
开发者ID:automenta,项目名称:opennars,代码行数:11,代码来源:ReasonerBatch.java

示例2: reset

import nars.entity.Stamp; //导入依赖的package包/类
/**
 * Reset the system with an empty memory and reset clock. Called locally and
 * from {@link NARControls}.
 */     
public void reset() {
        
    walkingSteps = 0;
    clock = 0;
    memory.init();
    Stamp.init();
    
    output(OUT.class, "reset");
            
}
 
开发者ID:automenta,项目名称:opennars,代码行数:15,代码来源:NAR.java

示例3: reset

import nars.entity.Stamp; //导入依赖的package包/类
/**
 * Reset the system with an empty memory and reset clock. Called locally and
 * from {@link NARWindow}.
 */     
public void reset() {
        
    walkingSteps = 0;
    clock = 0;
    memory.init();
    Stamp.init();
    
    output(OUT.class, "reset");
            
}
 
开发者ID:opennars,项目名称:pei,代码行数:15,代码来源:NAR.java

示例4: derivedTask

import nars.entity.Stamp; //导入依赖的package包/类
/**
     * Derived task comes from the inference rules.
     *
     * @param task the derived task
     */
    private void derivedTask(Task task, boolean revised, boolean single) {
        if (task.getBudget().aboveThreshold()) {
            if (task.getSentence() != null && task.getSentence().getTruth() != null) {
                float conf = task.getSentence().getTruth().getConfidence();
                if (conf == 0) { //no confidence - we can delete the wrongs out that way.
                    if (recorder.isActive()) {
                        recorder.append("!!! Ignored (confidence): " + task + "\n");
                    }
                    return;
                }
            }
            Stamp stamp = task.getSentence().getStamp();
            List<Term> chain = stamp.getChain();
            
	    if (currentBelief != null) {
                if(chain.contains(currentBelief.getContent())) {
                    chain.remove(currentBelief.getContent());
                }
                stamp.addToChain(currentBelief.getContent());
            }
            if (currentTask != null && !single) {
                if(chain.contains(currentTask.getContent())) {
                    chain.remove(currentTask.getContent());
                }
                stamp.addToChain(currentTask.getContent());
            }
            if (!revised) { //its a inference rule, we have to do the derivation chain check to hamper cycles
                for (final Term chain1 : chain) {
                    if (task.getContent() == chain1) {
                        if (recorder.isActive()) {
                            recorder.append("!!! Cyclic Reasoning detected: " + task + "\n");
                        }
                        return;
                    }
                }
            } else { //its revision, of course its cyclic, apply evidental base policy
                for (int i = 0; i < stamp.length(); i++) {
                    for (int j = 0; j < stamp.length(); j++) {
                        if (i != j && stamp.getBase()[i] == stamp.getBase()[j]) {
                            if (recorder.isActive()) {
                                recorder.append("!!! Overlapping Evidence on Revision detected: " + task + "\n");
                            }
                            return;
                        }
                    }
                }
            }
            if (recorder.isActive()) {
                recorder.append("!!! Derived: " + task + "\n");
            }
            float budget = task.getBudget().summary();
//            float minSilent = reasoner.getMainWindow().silentW.value() / 100.0f;
            float minSilent = reasoner.param.getSilenceLevel() / 100.0f;
            if (budget > minSilent) {  // only report significant derived Tasks
                reasoner.output(OUT.class, task.getSentence());
            }
            newTasks.add(task);
        } else {
            if (recorder.isActive()) {
                recorder.append("!!! Ignored: " + task + "\n");
            }
        }
    }
 
开发者ID:automenta,项目名称:opennars,代码行数:69,代码来源:Memory.java

示例5: derivedTask

import nars.entity.Stamp; //导入依赖的package包/类
/**
     * Derived task comes from the inference rules.
     *
     * @param task the derived task
     */
    private void derivedTask(Task task, boolean revised, boolean single) {
        if (task.getBudget().aboveThreshold()) {
            if (task.getSentence() != null && task.getSentence().getTruth() != null) {
                float conf = task.getSentence().getTruth().getConfidence();
                if (conf == 0) { //no confidence - we can delete the wrongs out that way.
                    if (recorder.isActive()) {
                        recorder.append("!!! Ignored (confidence): " + task + "\n");
                    }
                    return;
                }
            }
            Stamp stamp = task.getSentence().getStamp();
            List<Term> chain = stamp.getChain();
            
	    if (currentBelief != null) {
                if(chain.contains(currentBelief.content)) {
                    chain.remove(currentBelief.content);
                }
                stamp.addToChain(currentBelief.content);
            }
            if (currentTask != null && !single) {
                if(chain.contains(currentTask.getContent())) {
                    chain.remove(currentTask.getContent());
                }
                stamp.addToChain(currentTask.getContent());
            }
            if (!revised) { //its a inference rule, we have to do the derivation chain check to hamper cycles
                for (final Term chain1 : chain) {
                    if (task.getContent() == chain1) {
                        if (recorder.isActive()) {
                            recorder.append("!!! Cyclic Reasoning detected: " + task + "\n");
                        }
                        return;
                    }
                }
            } else { //its revision, of course its cyclic, apply evidental base policy
                for (int i = 0; i < stamp.length(); i++) {
                    for (int j = 0; j < stamp.length(); j++) {
                        if (i != j && stamp.getBase()[i] == stamp.getBase()[j]) {
                            if (recorder.isActive()) {
                                recorder.append("!!! Overlapping Evidence on Revision detected: " + task + "\n");
                            }
                            return;
                        }
                    }
                }
            }
            if (recorder.isActive()) {
                recorder.append("!!! Derived: " + task + "\n");
            }
            float budget = task.getBudget().summary();
//            float minSilent = reasoner.getMainWindow().silentW.value() / 100.0f;
            float minSilent = reasoner.param.getSilenceLevel() / 100.0f;
            if (budget > minSilent) {  // only report significant derived Tasks
                reasoner.output(OUT.class, task.getSentence());
            }
            newTasks.add(task);
        } else {
            if (recorder.isActive()) {
                recorder.append("!!! Ignored: " + task + "\n");
            }
        }
    }
 
开发者ID:opennars,项目名称:pei,代码行数:69,代码来源:Memory.java


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