int space = request.indexOf(" ", slash); String eword = request.substring(slash+1, space); String gword = (String)queryword.execute("$eword", eword); System.out.println(request);
/** * Do a plan step. */ public void body() { IExpression queryword = getExpression("query_egword"); StringTokenizer stok = new StringTokenizer((String)((IMessageEvent)getReason()) .getParameter(SFipa.CONTENT).getValue(), " "); if(stok.countTokens()==3) { stok.nextToken(); stok.nextToken(); String eword = stok.nextToken(); String gword = (String)queryword.execute("$eword", eword); if(gword!=null) { getLogger().info("Translating from english to german: "+eword+" - "+gword); } else { getLogger().info("Sorry word is not in database: "+eword); } } else { getLogger().warning("Sorry format not correct."); } } }
@Classname("refD") public IFuture<Void> execute(IInternalAccess ia) { IBDIXAgentFeature bia = ia.getComponentFeature(IBDIXAgentFeature.class); IExpression exp = bia.getExpressionbase().getExpression("search_reports"); final List res = (List)exp.execute("$order", order); SwingUtilities.invokeLater(new Runnable() { public void run() { while(detailsdm.getRowCount()>0) detailsdm.removeRow(0); for(int i=0; i<res.size(); i++) { detailsdm.addRow(new Object[]{res.get(i)}); //System.out.println(""+i+res.get(i)); } } }); return IFuture.DONE; } });
/** * The plan body. */ public void body() { // Select randomly one of the least seen locations. List<MapPoint> mps = (List<MapPoint>)getExpression("query_min_seen").execute(); MapPoint mp = (MapPoint)mps.get(0); int cnt = 1; for( ; cnt<mps.size(); cnt++) { MapPoint mp2 = (MapPoint)mps.get(cnt); if(mp.getSeen()!=mp2.getSeen()) break; } mp = (MapPoint)mps.get(rnd.nextInt(cnt)); // MapPoint[] mps = (MapPoint[])getBeliefbase().getBeliefSet("visited_positions").getFacts(); // MapPoint mp = mps[(int)(Math.random()*mps.length)]; Location dest = mp.getLocation(); IGoal moveto = createGoal("achievemoveto"); moveto.getParameter("location").setValue(dest); // System.out.println("Created: "+dest+" "+this); dispatchSubgoalAndWait(moveto); // System.out.println("Reached: "+dest+" "+this); }
/** * The plan body. */ public void body() { // Select randomly one of the seldom visited locations. List<MapPoint> mps = (List<MapPoint>)getExpression("query_min_quantity").execute(); MapPoint mp = mps.get(0); int cnt = 1; for( ; cnt<mps.size(); cnt++) { MapPoint mp2 = (MapPoint)mps.get(cnt); if(mp.getSeen()!=mp2.getSeen()) break; } mp = (MapPoint)mps.get(rnd.nextInt(cnt)); // MapPoint[] mps = (MapPoint[])getBeliefbase().getBeliefSet("visited_positions").getFacts(); // MapPoint mp = mps[(int)(Math.random()*mps.length)]; Location dest = mp.getLocation(); IGoal moveto = createGoal("achievemoveto"); moveto.getParameter("location").setValue(dest); // System.out.println("Created: "+dest+" "+this); dispatchSubgoalAndWait(moveto); // System.out.println("Reached: "+dest+" "+this); } }
String gword = stok.nextToken(); Object test = testword.execute("$eword", eword); if(test==null)
String eword = stok.nextToken(); String gword = stok.nextToken(); Object words = testword.execute("$eword", eword); if(words==null)
String dir = stok.nextToken(); String eword = stok.nextToken(); String gword = (String)query_word.execute("$eword", eword); if(gword!=null)
stok.nextToken(); String eword = stok.nextToken(); String gword = (String)query_word.execute("$eword", eword); if(gword!=null)
stok.nextToken(); String eword = stok.nextToken(); String gword = (String)query_word.execute("$eword", eword); if(gword!=null)
/** * The plan body. */ public void body() { IExpression query_word = getExpression("query_efword"); String eword = (String)getParameter("word").getValue(); String fword = (String)query_word.execute("$eword", eword); if(fword!=null) { getParameter("result").setValue(fword); getLogger().info("Translating from english to german: "+eword+" - "+fword); } else { getLogger().info("Sorry word is not in database: "+eword); fail(); } } }
Object result = getExpression("exp").execute("$num", Integer.valueOf(0)); getLogger().info("0: "+result); result = getExpression("exp").execute("$num", Integer.valueOf(1)); getLogger().info("1: "+result); tr.setSucceeded(true); getLogger().info(""+getExpression("join").execute()); tr.setSucceeded(true);
stok.nextToken(); String eword = stok.nextToken(); String gword = (String)query_word.execute("$eword", eword); if(gword!=null)
/** * Execute a plan. */ public void body() { IExpression queryword = getExpression("query_egword"); String eword = (String)getParameter("word").getValue(); String gword = (String)queryword.execute("$eword", eword); if(gword!=null) { //getLogger().info("Translating from english to german: "+eword+" - "+gword); getParameter("result").setValue(gword); } else { getLogger().info("Sorry word is not in database: "+eword); fail(); } } }
String eword = stok.nextToken(); String gword = stok.nextToken(); Object words = testword.execute("$eword", eword); if(words==null)
String eword = stok.nextToken(); String gword = stok.nextToken(); Object words = testword.execute("$eword", eword); if(words==null)
/** * The plan body. */ public void body() { IExpression query_word = getExpression("query_efword"); if(!"english_french".equals(getParameter("direction").getValue())) { getLogger().warning("Cannot translate direction: "+getParameter("direction").getValue()); fail(); } String eword = (String)getParameter("word").getValue(); String fword = (String)query_word.execute("$eword", eword); if(fword!=null) { //getLogger().info("Translating from english to german: "+eword+" - "+fword); getParameter("result").setValue(fword); } else { fail(); //getLogger().info("Sorry word is not in database: "+eword); } } }
/** * The plan body. */ public void body() { IExpression queryword = getExpression("query_egword"); if(!"english_german".equals(getParameter("direction").getValue())) { getLogger().warning("Cannot translate direction: "+getParameter("direction").getValue()); fail(); } String eword = (String)getParameter("word").getValue(); String gword = (String)queryword.execute("$eword", eword); if(gword!=null) { //getLogger().info("Translating from english to german: "+eword+" - "+gword); getParameter("result").setValue(gword); } else { //getLogger().info("Sorry word is not in database: "+eword); fail(); } } }
+ " where $order.getTitle().equals($task) && $order.getState().equals(Order.OPEN)" + " order by ($beliefbase.time - $order.getStartTime()) / ($order.getDeadline().getTime()-$order.getStartTime())") .execute("$task", getParameter("cfp").getValue());