use of nars.language.Term in project opennars by opennars.
the class Doubt method execute.
/**
* To activate a concept as if a question has been asked about it
*
* @param args Arguments, a Statement followed by an optional tense
* @param memory The memory in which the operation is executed
* @return Immediate results as Tasks
*/
@Override
protected ArrayList<Task> execute(Operation operation, Term[] args, Memory memory) {
Term term = args[1];
Concept concept = memory.conceptualize(Consider.budgetMentalConcept(operation), term);
concept.discountConfidence(true);
return null;
}
use of nars.language.Term in project opennars by opennars.
the class Hesitate method execute.
/**
* To activate a concept as if a question has been asked about it
*
* @param args Arguments, a Statement followed by an optional tense
* @param memory The memory in which the operation is executed
* @return Immediate results as Tasks
*/
@Override
protected ArrayList<Task> execute(Operation operation, Term[] args, Memory memory) {
Term term = args[1];
Concept concept = memory.conceptualize(Consider.budgetMentalConcept(operation), term);
concept.discountConfidence(false);
return null;
}
use of nars.language.Term in project opennars by opennars.
the class Name method execute.
/**
* To create a judgment with a given statement
* @param args Arguments, a Statement followed by an optional tense
* @param memory The memory in which the operation is executed
* @return Immediate results as Tasks
*/
@Override
protected ArrayList<Task> execute(Operation operation, Term[] args, Memory memory) {
Term compound = args[1];
Term atomic = args[2];
Similarity content = Similarity.make(compound, atomic);
// a naming convension
TruthValue truth = new TruthValue(1, 0.9999f);
Sentence sentence = new Sentence(content, Symbols.JUDGMENT_MARK, truth, new Stamp(memory));
BudgetValue budget = new BudgetValue(Parameters.DEFAULT_JUDGMENT_PRIORITY, Parameters.DEFAULT_JUDGMENT_DURABILITY, truth);
return Lists.newArrayList(new Task(sentence, budget, true));
}
use of nars.language.Term in project opennars by opennars.
the class InheritanceGraph method add.
@Override
public boolean add(Sentence s, CompoundTerm ct, Item c) {
if (ct instanceof Statement) {
Statement st = (Statement) ct;
Term subject = st.getSubject();
Term predicate = st.getPredicate();
addVertex(subject);
addVertex(predicate);
System.out.println(subject.toString().trim() + " " + predicate.toString().trim() + " " + s.truth.getExpectation() + s.truth.getFrequency() + " " + s.truth.getConfidence() + " " + " Inheritance");
addEdge(subject, predicate, s);
return true;
}
return false;
}
use of nars.language.Term in project opennars by opennars.
the class SentenceGraph method remove.
protected boolean remove(Sentence s) {
List<E> componentList = components.get(s);
if (componentList != null) {
for (E e : componentList) {
if (!containsEdge(e))
continue;
Term source = getEdgeSource(e);
Term target = getEdgeTarget(e);
removeEdge(e);
ensureTermConnected(source);
ensureTermConnected(target);
}
componentList.clear();
components.remove(s);
return true;
}
return false;
}
Aggregations