/** * Dispatch a new top-level goal. * @param goal The new goal. * Note: plan step is interrupted after call. */ public void dispatchTopLevelGoal(IGoal goal) { getGoalbase().dispatchTopLevelGoal(goal); }
/** * Dispatch a top level goal. */ public IFuture<Object> dispatchTopLevelGoal(Object goal) { IBDIXAgentFeature bdif = component.getComponentFeature(IBDIXAgentFeature.class); return bdif.getGoalbase().dispatchTopLevelGoal((IGoal)goal); }
/** * Dispatch a top level goal. */ public IFuture<Object> dispatchTopLevelGoal(Object goal) { IBDIXAgentFeature bdif = component.getComponentFeature(IBDIXAgentFeature.class); return bdif.getGoalbase().dispatchTopLevelGoal((IGoal)goal); }
/** * Buy an item. * @param item The item. */ public IFuture<ItemInfo> buyItem(final String item, final double price) { IBDIXAgentFeature capa = comp.getComponentFeature(IBDIXAgentFeature.class); final IGoal sell = capa.getGoalbase().createGoal("sell"); sell.getParameter("name").setValue(item); sell.getParameter("price").setValue(Double.valueOf(price)); return capa.getGoalbase().dispatchTopLevelGoal(sell); }
bfx.getGoalbase().dispatchTopLevelGoal((IGoal)goal).addResultListener(lis);
ia.getComponentFeature(IBDIXAgentFeature.class).getGoalbase().dispatchTopLevelGoal(goal) .addResultListener(new IResultListener<Object>()
/** * Buy a book * @param title The book title. * @param price The price to pay. * @return A future indicating if the transaction was successful. */ public IFuture<Void> acceptProposal(String title, int price) { final Future<Void> ret = new Future<Void>(); final IGoal goal = agent.getGoalbase().createGoal("cnp_execute_task"); goal.getParameter("cfp").setValue(title); goal.getParameter("proposal").setValue(Integer.valueOf(price)); agent.getGoalbase().dispatchTopLevelGoal(goal) .addResultListener(new ExceptionDelegationResultListener<Object, Void>(ret) { public void customResultAvailable(Object result) { ret.setResult(null); } }); return ret; }
/** * Ask the seller for a a quote on a book. * @param title The book title. * @return The price. */ public IFuture<Integer> callForProposal(String title) { final Future<Integer> ret = new Future<Integer>(); final IGoal goal = agent.getGoalbase().createGoal("cnp_make_proposal"); goal.getParameter("cfp").setValue(title); agent.getGoalbase().dispatchTopLevelGoal(goal) .addResultListener(new ExceptionDelegationResultListener<Object, Integer>(ret) { public void customResultAvailable(Object result) { ret.setResult((Integer)goal.getParameter("proposal").getValue()); } }); return ret; }
IFuture<Void> fut = capa.getGoalbase().dispatchTopLevelGoal(g); fut.addResultListener(new DelegationResultListener<Void>(ret)
capa.getGoalbase().dispatchTopLevelGoal(clearchem).addResultListener(new IResultListener<Object>()
capa.getGoalbase().dispatchTopLevelGoal(exfire).addResultListener(new IResultListener<Object>()
capa.getGoalbase().dispatchTopLevelGoal(tv).addResultListener(new IResultListener<Object>()