Skip to content

Commit

Permalink
Merge pull request #82 from opennars/pr_confDouble1
Browse files Browse the repository at this point in the history
changed type of confidence to double
  • Loading branch information
patham9 authored Sep 18, 2019
2 parents 9327d95 + d02d609 commit 087e0fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/main/java/org/opennars/lab/vision/SymRecognizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@
import org.xml.sax.SAXException;



public class SymRecognizer extends javax.swing.JFrame {

private Image fitimage(Image img , int w , int h)
{
BufferedImage resizedimage = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
Expand Down Expand Up @@ -386,7 +384,7 @@ private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
public void onSolution(Sentence belief) {
//System.out.println("solution: " + belief);
System.out.println(belief);
float howconf = belief.truth.getConfidence();
double howconf = belief.truth.getConfidence();
if(howconf > 0.1f) { //only mark if above 0.1 confidence
//also mark image:
int maxu = Integer.valueOf(belief.getTerm().toString().split("example")[1].split("}")[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
public void onSolution(Sentence belief) {
//System.out.println("solution: " + belief);
System.out.println(belief);
float howconf = belief.truth.getConfidence();
double howconf = belief.truth.getConfidence();
if(howconf >= 0.001f && belief.getTerm().toString().contains("example")) { //only mark if above 0.1 confidence
//also mark image:
int maxu = Integer.valueOf(belief.getTerm().toString().split("example")[1].split("\\)")[0]);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/opennars/util/test/TuneTuffy.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void onJudgment(Sentence s) {
if (mostConfident == null)
mostConfident = s;
else {
float existingConf = mostConfident.truth.getConfidence();
double existingConf = mostConfident.truth.getConfidence();
if (existingConf < s.truth.getConfidence())
mostConfident = s;
}
Expand Down

0 comments on commit 087e0fd

Please sign in to comment.