Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected boolean processGoal(final NAL nal, final Task task) {
- final Sentence goal = task.sentence;
- final Sentence oldGoal = selectCandidate(goal, desires); // revise with the existing desire values
- boolean revised=false;
- if (oldGoal != null) {
- final Stamp newStamp = goal.stamp;
- final Stamp oldStamp = oldGoal.stamp;
- if (newStamp.equals(oldStamp)) {
- if (task.getParentTask() != null && task.getParentTask().sentence.isGoal()) {
- memory.removeTask(task, "Duplicated");
- }
- return false;
- } else if (revisible(goal, oldGoal)) {
- nal.setTheNewStamp(newStamp, oldStamp, memory.time());
- nal.setCurrentTask(task);
- revision(goal,oldGoal,false,nal);
- return false;
- }
- }
- if (task.aboveThreshold()) {
- final Sentence belief = selectCandidate(goal, beliefs); // check if the Goal is already satisfied
- if (belief != null) {
- trySolution(belief, task, nal);
- }
- // still worth pursuing?
- if (task.aboveThreshold()) {
- addToTable(task, goal, desires, memory.param.conceptGoalsMax.get(), ConceptGoalAdd.class, ConceptGoalRemove.class);
- if (!Executive.isExecutableTerm(task.sentence.content)) {
- //memory.activatedTask(task, budget, belief, belief);
- //memory.activatedTask(task, task.budget, belief, belief);
- memory.addNewTask(new Task(goal,task.budget), "Derived");
- //memory.executive.decisionPlanning(nal, task, this);
- } else {
- memory.executive.decisionMaking(task, this);
- return false;
- }
- return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement