use of jcog.bag.impl.CurveBag in project narchy by automenta.
the class ArrayBagTest method testInsertOrBoostDoesntCauseSort.
@Disabled
@Test
public void testInsertOrBoostDoesntCauseSort() {
final int[] sorts = { 0 };
@NotNull CurveBag<PLink<String>> x = new CurveBag(PriMerge.plus, new HashMap<>(), 4) {
@Override
protected void sort(int from, int to) {
sorts[0]++;
super.sort(from, to);
}
};
x.put(new PLink("x", 0.2f));
x.put(new PLink("y", 0.1f));
x.put(new PLink("z", 0f));
assertEquals(0, sorts[0]);
x.commit();
assertEquals(0, sorts[0]);
assertSorted(x);
}
use of jcog.bag.impl.CurveBag in project narchy by automenta.
the class BagLab method main.
public static void main(String[] arg) {
BagLab bagLab = new BagLab(new CurveBag(plus, new HashMap(), 256));
SpaceGraph.window(bagLab.surface(), 1200, 800);
long delayMS = 30;
// new Thread(()->{
while (true) {
bagLab.update();
Util.sleep(delayMS);
}
// }).start();
}