public OAAClient(String agentName, String[] libcomargs) throws IOException { outOaa = new LibOaa(new LibCom(new LibComTcpProtocol(), libcomargs)); if (!outOaa.oaaSetupCommunication(agentName)) throw new IOException("Could not connect to facilitator"); if (!outOaa.oaaRegister("parent", agentName, new IclList(), new IclList())) throw new IOException("Could not register"); outOaa.oaaReady(true); }
/** * Send a task to the agent community. * * @param goal The task * @param params Parameters * @return A possibly empty list of solutions. */ public List<IclTerm> solve(IclTerm goal, List<IclTerm> params) { IclList answers = new IclList(); if (!outOaa.oaaSolve(goal, IclUtil.fromList(params), answers)) return Collections.<IclTerm>emptyList(); return IclUtil.toList(answers); }