Skip to content

Commit

Permalink
Merge pull request #6 from opennars/pisaev_achieving_level
Browse files Browse the repository at this point in the history
Fixed achieving level
  • Loading branch information
pisaev1 authored Oct 10, 2021
2 parents 13abe29 + bdd6f22 commit 6903395
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions nars_core_java/nars/entity/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,18 +269,22 @@ public Task getParentTask() {
}

/**
* Revise in future since logic is not correct
* Returns Achieving level of a task. Idea is if a contradicting belief exists
* then spend more resources on it, thus the less the achieving level,
* the bigger the contradiction and more resources needs to be spent.
* Only called from processBuffer() from Memory.java when a task is pre-processed
* @param c
* @return
*/
public double getAchievingLevel(Concept c){
if (this.sentence.isJudgment() || this.sentence.isGoal()){
Sentence MatchBelief = c.getBeliefs().get(0); // Not Correct
Sentence MatchBelief = c.getBeliefs().get(0);
if (MatchBelief != null){
return 1 - Math.abs(this.sentence.getTruth().getExpectation() - MatchBelief.getTruth().getExpectation());
}
}else if(this.sentence.isQuestion() || this.sentence.isQuest()){
if (this.sentence != null){
return 1 - Math.abs(this.sentence.getTruth().getExpectation() - bestSolution.getTruth().getExpectation());
return 1 - Math.abs(this.sentence.getTruth().getExpectation() - this.bestSolution.getTruth().getExpectation());
}
}
return Math.abs(this.sentence.getTruth().getExpectation()-0.5);
Expand Down

0 comments on commit 6903395

Please sign in to comment.