diff --git a/src/main/java/org/opennars/gui/graph/ImplicationGraph.java b/src/main/java/org/opennars/gui/graph/ImplicationGraph.java index 37c5d69e987365d86cef280a8d7a102facc9c273..35cae45e97b25cedc6316212860ad4f4f120a479 100755 --- a/src/main/java/org/opennars/gui/graph/ImplicationGraph.java +++ b/src/main/java/org/opennars/gui/graph/ImplicationGraph.java @@ -38,7 +38,7 @@ public class ImplicationGraph extends SentenceGraph { @Override public boolean allow(final Sentence s) { - float conf = s.truth.getConfidence(); + double conf = s.truth.getConfidence(); return conf > minConfidence; } diff --git a/src/main/java/org/opennars/gui/graph/InheritanceGraph.java b/src/main/java/org/opennars/gui/graph/InheritanceGraph.java index 4db89027312d8ca7fedd23b199a76d82739a21fe..788b72c9d95e4427434c1d218b966e158ef74510 100755 --- a/src/main/java/org/opennars/gui/graph/InheritanceGraph.java +++ b/src/main/java/org/opennars/gui/graph/InheritanceGraph.java @@ -38,7 +38,7 @@ public class InheritanceGraph extends SentenceGraph { @Override public boolean allow(final Sentence s) { - float conf = s.truth.getConfidence(); + double conf = s.truth.getConfidence(); return conf > minConfidence; } diff --git a/src/main/java/org/opennars/gui/output/ConceptsPanel.java b/src/main/java/org/opennars/gui/output/ConceptsPanel.java index cb6c39b294fc673e733366e338419fa0ffe22d32..a9fe49a7b958cd0997f2d1b10fbe550b848eb1d4 100755 --- a/src/main/java/org/opennars/gui/output/ConceptsPanel.java +++ b/src/main/java/org/opennars/gui/output/ConceptsPanel.java @@ -450,7 +450,7 @@ public class ConceptsPanel extends NPanel implements EventObserver, Runnable { float freq = s.getTruth().getFrequency(); - float conf = s.getTruth().getConfidence(); + float conf = (float)s.getTruth().getConfidence(); int y = (int)((1.0f - freq) * (this.h - thick)); @@ -473,9 +473,9 @@ public class ConceptsPanel extends NPanel implements EventObserver, Runnable { public static Color getColor(float freq, float conf, float factor, Parameters narParameters) { float ii = 0.25f + (factor * conf) * 0.75f; - float evidence = TruthFunctions.c2w(conf, narParameters); - float positive_evidence_in_0_1 = TruthFunctions.w2c(evidence*freq, narParameters); - float negative_evidence_in_0_1 = TruthFunctions.w2c(evidence*(1.0f-freq), narParameters); + float evidence = (float)TruthFunctions.c2w(conf, narParameters); + float positive_evidence_in_0_1 = (float)TruthFunctions.w2c(evidence*freq, narParameters); + float negative_evidence_in_0_1 = (float)TruthFunctions.w2c(evidence*(1.0f-freq), narParameters); return new Color(positive_evidence_in_0_1,0.0f, negative_evidence_in_0_1, ii); } @@ -495,7 +495,7 @@ public class ConceptsPanel extends NPanel implements EventObserver, Runnable { g.fillRect(0, 0, getWidth(), getHeight()); for (Sentence s : i) { float freq = s.getTruth().getFrequency(); - float conf = s.getTruth().getConfidence(); + float conf = (float)s.getTruth().getConfidence(); float factor = 1.0f; if (s instanceof Sentence) { diff --git a/src/main/java/org/opennars/gui/output/SentenceTablePanel.java b/src/main/java/org/opennars/gui/output/SentenceTablePanel.java index 596940abb84e3d307186dbc819be56783f3881ab..fa4df9a77ae3184cecb9afbbfd6e1981a33d827b 100755 --- a/src/main/java/org/opennars/gui/output/SentenceTablePanel.java +++ b/src/main/java/org/opennars/gui/output/SentenceTablePanel.java @@ -212,7 +212,7 @@ public class SentenceTablePanel extends TablePanel { TruthValue truth = s.truth; if (truth != null) { freq = truth.getFrequency(); - conf = truth.getConfidence(); + conf = (float)truth.getConfidence(); } Task pt = null; //t.getParentTask(); diff --git a/src/main/java/org/opennars/gui/output/SwingLogText.java b/src/main/java/org/opennars/gui/output/SwingLogText.java index 40aed3363a829136751f23dee5e81c2663e3d827..9ad2994a3a4bb212826c9434ffa0344d36f7a4f5 100755 --- a/src/main/java/org/opennars/gui/output/SwingLogText.java +++ b/src/main/java/org/opennars/gui/output/SwingLogText.java @@ -206,18 +206,18 @@ public class SwingLogText extends SwingText { TruthValue tv = s.truth; if (tv!=null) { - float evidence = TruthFunctions.c2w(tv.getConfidence(), this.nar.narParameters); - float pos_2 = tv.getConfidence()*tv.getFrequency(); - float positive_evidence_in_0_1 = TruthFunctions.w2c(evidence*tv.getFrequency(), this.nar.narParameters); - float negative_evidence_in_0_1 = TruthFunctions.w2c(evidence*(1.0f-tv.getFrequency()), this.nar.narParameters); + float evidence = (float)TruthFunctions.c2w(tv.getConfidence(), this.nar.narParameters); + float pos_2 = (float)tv.getConfidence()*tv.getFrequency(); + float positive_evidence_in_0_1 = (float)TruthFunctions.w2c(evidence*tv.getFrequency(), this.nar.narParameters); + float negative_evidence_in_0_1 = (float)TruthFunctions.w2c(evidence*(1.0f-tv.getFrequency()), this.nar.narParameters); printColorBlock(LogPanel.getPositiveEvidenceColor(positive_evidence_in_0_1), " "); printColorBlock(LogPanel.getNegativeEvidenceColor(negative_evidence_in_0_1), " "); } else if ( t.getBestSolution()!=null) { - float evidence = TruthFunctions.c2w(t.getBestSolution().truth.getConfidence(), this.nar.narParameters); - float pos_2 = t.getBestSolution().truth.getConfidence()*t.getBestSolution().truth.getFrequency(); - float positive_evidence_in_0_1 = TruthFunctions.w2c(evidence*t.getBestSolution().truth.getFrequency(), this.nar.narParameters); - float negative_evidence_in_0_1 = TruthFunctions.w2c(evidence*(1.0f-t.getBestSolution().truth.getFrequency()), this.nar.narParameters); + float evidence = (float)TruthFunctions.c2w(t.getBestSolution().truth.getConfidence(), this.nar.narParameters); + float pos_2 = (float)t.getBestSolution().truth.getConfidence()*t.getBestSolution().truth.getFrequency(); + float positive_evidence_in_0_1 = (float)TruthFunctions.w2c(evidence*t.getBestSolution().truth.getFrequency(), this.nar.narParameters); + float negative_evidence_in_0_1 = (float)TruthFunctions.w2c(evidence*(1.0f-t.getBestSolution().truth.getFrequency()), this.nar.narParameters); //printColorBlock(LogPanel.getStatementColor('=', priority, t.getBestSolution().truth.get), " "); printColorBlock(LogPanel.getPositiveEvidenceColor(positive_evidence_in_0_1), " "); printColorBlock(LogPanel.getNegativeEvidenceColor(negative_evidence_in_0_1), " "); diff --git a/src/main/java/org/opennars/gui/output/TaskTree.java b/src/main/java/org/opennars/gui/output/TaskTree.java index 4f590c0665c965c86c1521d1723ce8706a7c0a34..fc129746617b71301453eefc3c6e4c72b3808cd9 100755 --- a/src/main/java/org/opennars/gui/output/TaskTree.java +++ b/src/main/java/org/opennars/gui/output/TaskTree.java @@ -309,7 +309,7 @@ public class TaskTree extends NPanel implements EventObserver, Runnable { Color iColor; if (desire!=null) { - float confidence = t.sentence.truth.getConfidence(); + float confidence = (float)t.sentence.truth.getConfidence(); iColor = new Color(0,confidence/1.5f,conPri/1.5f,0.75f + 0.25f * confidence); } else { diff --git a/src/main/java/org/opennars/gui/output/graph/NARGraphDisplay.java b/src/main/java/org/opennars/gui/output/graph/NARGraphDisplay.java index 82d99a67704fc10b608334e5290d55ffcab92f7a..794449123b26e7fd8bccb7a12b8e1f51c00352ec 100755 --- a/src/main/java/org/opennars/gui/output/graph/NARGraphDisplay.java +++ b/src/main/java/org/opennars/gui/output/graph/NARGraphDisplay.java @@ -80,7 +80,7 @@ public class NARGraphDisplay<V,E> implements GraphDisplay<V,E> { if (o instanceof Sentence) { Sentence kb = (Sentence) o; if (kb.truth!=null) { - float confidence = kb.truth.getConfidence(); + float confidence = (float)kb.truth.getConfidence(); alpha = 0.5f + 0.5f * confidence; } } else if (o instanceof Task) { @@ -95,7 +95,7 @@ public class NARGraphDisplay<V,E> implements GraphDisplay<V,E> { if (!co.beliefs.isEmpty()) { - float confidence = co.beliefs.get(0).sentence.truth.getConfidence(); + float confidence = (float)co.beliefs.get(0).sentence.truth.getConfidence(); alpha = 0.5f + 0.5f * confidence; } } @@ -122,12 +122,12 @@ public class NARGraphDisplay<V,E> implements GraphDisplay<V,E> { Task t = (Task) o; if(t.sentence.truth!=null) { - float conf = t.sentence.truth.getConfidence(); + float conf = (float)t.sentence.truth.getConfidence(); float freq = t.sentence.truth.getFrequency(); aa = 0.25f + conf * 0.75f; - float evidence = TruthFunctions.c2w(conf, this.nar.narParameters); - float positive_evidence_in_0_1 = TruthFunctions.w2c(evidence*freq, this.nar.narParameters); - float negative_evidence_in_0_1 = TruthFunctions.w2c(evidence*(1.0f-freq), this.nar.narParameters); + float evidence = (float)TruthFunctions.c2w(conf, this.nar.narParameters); + float positive_evidence_in_0_1 = (float)TruthFunctions.w2c(evidence*freq, this.nar.narParameters); + float negative_evidence_in_0_1 = (float)TruthFunctions.w2c(evidence*(1.0f-freq), this.nar.narParameters); rr = positive_evidence_in_0_1; bb = negative_evidence_in_0_1; gg = 0.0f; @@ -146,12 +146,12 @@ public class NARGraphDisplay<V,E> implements GraphDisplay<V,E> { if(conc.beliefs.size()>0) { Sentence sent = conc.beliefs.get(0).sentence; - float conf = sent.truth.getConfidence(); + float conf = (float)sent.truth.getConfidence(); float freq = sent.truth.getFrequency(); aa = 0.25f + conf * 0.75f; - float evidence = TruthFunctions.c2w(conf, this.nar.narParameters); - float positive_evidence_in_0_1 = TruthFunctions.w2c(evidence*freq, this.nar.narParameters); - float negative_evidence_in_0_1 = TruthFunctions.w2c(evidence*(1.0f-freq), this.nar.narParameters); + float evidence = (float)TruthFunctions.c2w(conf, this.nar.narParameters); + float positive_evidence_in_0_1 = (float)TruthFunctions.w2c(evidence*freq, this.nar.narParameters); + float negative_evidence_in_0_1 = (float)TruthFunctions.w2c(evidence*(1.0f-freq), this.nar.narParameters); rr = positive_evidence_in_0_1; bb = negative_evidence_in_0_1; gg = 0.0f;