hypobin.java
来自「机器学习算法中的CHC算法」· Java 代码 · 共 30 行
JAVA
30 行
package chc;import java.util.LinkedList;/** HypoBin is just a storage container made specifically for moving Hypothesis * between two threads. Its main pupose is to make Hypo passing in CHC easier. */public class HypoBin { /** A LinkedList to store the Hypothesis being stored. */ private LinkedList bin = new LinkedList(); public HypoBin() { } public synchronized void add(Hypothesis hypo) { bin.add(hypo); } public synchronized Hypothesis retrieve() { if (bin.size() > 0) { return (Hypothesis)bin.removeFirst(); } else { return null; } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?