Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. protected boolean processGoal(final NAL nal, final Task task) {
  2.  
  3. final Sentence goal = task.sentence;
  4. final Sentence oldGoal = selectCandidate(goal, desires); // revise with the existing desire values
  5. boolean revised=false;
  6.  
  7. if (oldGoal != null) {
  8. final Stamp newStamp = goal.stamp;
  9. final Stamp oldStamp = oldGoal.stamp;
  10.  
  11. if (newStamp.equals(oldStamp)) {
  12. if (task.getParentTask() != null && task.getParentTask().sentence.isGoal()) {
  13. memory.removeTask(task, "Duplicated");
  14. }
  15. return false;
  16. } else if (revisible(goal, oldGoal)) {
  17. nal.setTheNewStamp(newStamp, oldStamp, memory.time());
  18. nal.setCurrentTask(task);
  19. revision(goal,oldGoal,false,nal);
  20. return false;
  21. }
  22. }
  23.  
  24. if (task.aboveThreshold()) {
  25.  
  26. final Sentence belief = selectCandidate(goal, beliefs); // check if the Goal is already satisfied
  27.  
  28. if (belief != null) {
  29. trySolution(belief, task, nal);
  30. }
  31.  
  32. // still worth pursuing?
  33. if (task.aboveThreshold()) {
  34.  
  35. addToTable(task, goal, desires, memory.param.conceptGoalsMax.get(), ConceptGoalAdd.class, ConceptGoalRemove.class);
  36.  
  37. if (!Executive.isExecutableTerm(task.sentence.content)) {
  38. //memory.activatedTask(task, budget, belief, belief);
  39. //memory.activatedTask(task, task.budget, belief, belief);
  40. memory.addNewTask(new Task(goal,task.budget), "Derived");
  41. //memory.executive.decisionPlanning(nal, task, this);
  42. } else {
  43. memory.executive.decisionMaking(task, this);
  44. return false;
  45. }
  46. return true;
  47. }
  48. }
  49. return false;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement