diff --git a/open-nars/com/googlecode/opennars/entity/ShortFloat.java b/open-nars/com/googlecode/opennars/entity/ShortFloat.java index 654691d4cd1ac21c7d72066b32f5a35b72dc4109..21f4e19f9a329b873b2e83434e8e699f1e4391e4 100644 --- a/open-nars/com/googlecode/opennars/entity/ShortFloat.java +++ b/open-nars/com/googlecode/opennars/entity/ShortFloat.java @@ -46,7 +46,7 @@ public class ShortFloat implements Cloneable { // set new value, rounded, with validity checking public void setValue(float v) { if ((v < 0) || (v > 1)) - System.out.println("!!! Wrong value: " + v); + System.err.println("!!! Wrong value: " + v); else value = (short) (v * 10000.0 + 0.5); } diff --git a/open-nars/com/googlecode/opennars/inference/BudgetFunctions.java b/open-nars/com/googlecode/opennars/inference/BudgetFunctions.java index a491a76971d163c557ff49ec38d3d0e666e1596e..1538d5712fe38ab3c898cbe3fd7681ad572b0ea5 100644 --- a/open-nars/com/googlecode/opennars/inference/BudgetFunctions.java +++ b/open-nars/com/googlecode/opennars/inference/BudgetFunctions.java @@ -133,7 +133,7 @@ public class BudgetFunctions extends UtilityFunctions { /* ----------------------- Links ----------------------- */ public BudgetValue distributeAmongLinks(BudgetValue b, int n) { - float priority = (float) (b.getPriority() / Math.sqrt(n)); + float priority = (float) (b.getPriority() / (n==0 ? 1 : Math.sqrt(n))); return new BudgetValue(priority, b.getDurability(), b.getQuality(), memory); }