本文整理汇总了Java中jason.asSyntax.parser.ParseException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java ParseException.printStackTrace方法的具体用法?Java ParseException.printStackTrace怎么用?Java ParseException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jason.asSyntax.parser.ParseException
的用法示例。
在下文中一共展示了ParseException.printStackTrace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeVarsAnnon
import jason.asSyntax.parser.ParseException; //导入方法依赖的package包/类
public void makeVarsAnnon(Literal l, Unifier un) {
try {
for (int i=0; i<l.getArity(); i++) {
Term t = l.getTerm(i);
if (t.isString()) {
StringTerm st = (StringTerm)t;
Matcher matcher = regex.matcher(st.getString());
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
String sVar = matcher.group();
sVar = sVar.substring(2, sVar.length() - 1);
Term v = ASSyntax.parseTerm(sVar);
if (v.isVar()) {
VarTerm to = ((Structure)l).varToReplace(v, un);
matcher.appendReplacement(sb, "#{"+to.toString()+"}");
}
}
matcher.appendTail(sb);
l.setTerm(i, new StringTermImpl(sb.toString()));
}
}
} catch (ParseException pe) {
pe.printStackTrace();
}
}
示例2: init
import jason.asSyntax.parser.ParseException; //导入方法依赖的package包/类
@Override
public void init(String[] args) {
// associate agents to users
try {
for (int i=1; i<args.length; i++) {
Term t = ASSyntax.parseTerm(args[i]);
if (t.isStructure()) {
Structure arg = (Structure)t;
if (arg.getFunctor().equals("agent_entity")) {
addPercept(arg.getTerm(0).toString(), Literal.parseLiteral("myNameInContest("+arg.getTerm(2).toString()+")"));
agToMassimContest.put(arg.getTerm(0).toString(), arg.getTerm(2).toString());
}
}
}
super.init(args);
//startCartago();
} catch (ParseException e) {
e.printStackTrace();
}
startCartago(args);
}
示例3: testGroupToProlog
import jason.asSyntax.parser.ParseException; //导入方法依赖的package包/类
@Test
public void testGroupToProlog() {
//Group g = oe.getOS().getSS().getRootGrSpec().findSubGroup("attack");
// the order changes always, improve this test
//assertEquals("group_specification(attack,[role(middle,5,5,[leader],[link(communication,player,inter_group),link(communication,coach,inter_group)]),role(leader,0,1,[middle],[link(communication,player,inter_group),link(authority,player,inter_group),link(communication,coach,inter_group)]),role(attacker,2,2,[],[link(communication,player,inter_group),link(communication,coach,inter_group)])],[],properties([]))", g.getAsProlog());
//g = oe.getOS().getSS().getRootGrSpec();
// the order changes always, improve this test
//assertEquals("group_specification(team,[role(coach,1,2,[],[link(authority,player,inter_group)])],[attack(1,1),defense(1,1)],properties([]))", g.getAsProlog());
OS os = OS.loadOSFromURI("examples/auction/auction-os.xml");
System.out.println(os.getAsProlog());
Literal ospl = null;
try {
ospl = ASSyntax.parseLiteral(os.getAsProlog());
} catch (ParseException e) {
e.printStackTrace();
}
assertNotNull(ospl);
}