本文整理汇总了Java中jason.asSyntax.Literal.getNS方法的典型用法代码示例。如果您正苦于以下问题:Java Literal.getNS方法的具体用法?Java Literal.getNS怎么用?Java Literal.getNS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jason.asSyntax.Literal
的用法示例。
在下文中一共展示了Literal.getNS方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: provideBelEntry
import jason.asSyntax.Literal; //导入方法依赖的package包/类
private BelEntry provideBelEntry(Literal l) {
Map<PredicateIndicator, BelEntry> belsMap = belsMapDefaultNS;
if (l.getNS() != Literal.DefaultNS) {
belsMap = nameSpaces.get(l.getNS());
if (belsMap == null) {
belsMap = new ConcurrentHashMap<PredicateIndicator, DefaultBeliefBase.BelEntry>();
nameSpaces.put(l.getNS(), belsMap);
}
}
BelEntry entry = belsMap.get(l.getPredicateIndicator());
if (entry == null) {
entry = new BelEntry();
belsMap.put(l.getPredicateIndicator(), entry);
}
return entry;
}
示例2: unifiesNamespace
import jason.asSyntax.Literal; //导入方法依赖的package包/类
private boolean unifiesNamespace(Literal t1s, Literal t2s) {
if (t1s == Literal.DefaultNS && t2s == Literal.DefaultNS) { // if both are the default NS
return true;
}
Atom nst1 = (t1s == Literal.DefaultNS ? Literal.DefaultNS : t1s.getNS());
Atom nst2 = (t2s == Literal.DefaultNS ? Literal.DefaultNS : t2s.getNS());
//System.out.println(nst1.getFunctor()+" == "+ nst2.getFunctor()); //+" ==> "+unifiesNoUndo(nst1, nst2));
return unifiesNoUndo(nst1, nst2);
}
示例3: removeFromEntry
import jason.asSyntax.Literal; //导入方法依赖的package包/类
private boolean removeFromEntry(Literal l) {
if (l.hasSource()) {
return false;
} else {
Map<PredicateIndicator, BelEntry> belsMap = l.getNS() == Literal.DefaultNS ? belsMapDefaultNS : nameSpaces.get(l.getNS());
PredicateIndicator key = l.getPredicateIndicator();
BelEntry entry = belsMap.get(key);
entry.remove(l);
if (entry.isEmpty()) {
belsMap.remove(key);
}
size--;
return true;
}
}
示例4: contains
import jason.asSyntax.Literal; //导入方法依赖的package包/类
@Override
public Literal contains(Literal l) {
Map<PredicateIndicator, BelEntry> belsMap = l.getNS() == Literal.DefaultNS ? belsMapDefaultNS : nameSpaces.get(l.getNS());
if (belsMap == null)
return null;
BelEntry entry = belsMap.get(l.getPredicateIndicator());
if (entry == null) {
return null;
} else {
//logger.info("*"+l+":"+l.hashCode()+" = "+entry.contains(l)+" in "+this);//+" entry="+entry);
return entry.contains(l);
}
}
示例5: prepareArguments
import jason.asSyntax.Literal; //导入方法依赖的package包/类
@Override
public Term[] prepareArguments(Literal body, Unifier un) {
ns = body.getNS();
return super.prepareArguments(body, un);
}