use of nars.entity.BudgetValue in project opennars by opennars.
the class Feel method feeling.
/**
* To get the current value of an internal sensor
*
* @param value The value to be checked, in [0, 1]
* @param memory The memory in which the operation is executed
* @return Immediate results as Tasks
*/
protected ArrayList<Task> feeling(float value, Memory memory) {
Stamp stamp = new Stamp(memory, Tense.Present);
TruthValue truth = new TruthValue(value, Parameters.DEFAULT_JUDGMENT_CONFIDENCE);
Term predicate = new SetInt(feelingTerm);
Term content = Inheritance.make(selfSubject, predicate);
Sentence sentence = new Sentence(content, Symbols.JUDGMENT_MARK, truth, stamp);
float quality = BudgetFunctions.truthToQuality(truth);
BudgetValue budget = new BudgetValue(Parameters.DEFAULT_JUDGMENT_PRIORITY, Parameters.DEFAULT_JUDGMENT_DURABILITY, quality);
return Lists.newArrayList(new Task(sentence, budget, true));
}
Aggregations