當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。